From 28e10128fff866f5afa46eb4ebdb64058b526707 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Fri, 17 Oct 2025 20:57:27 +0800 Subject: [PATCH] =?UTF-8?q?nixos:=20nix=20=E7=89=88=E6=9C=AC=E5=8F=B7?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=9B=AE=E6=A0=87=E7=B3=BB=E7=BB=9F=E9=87=8C?= =?UTF-8?q?=E9=9D=A2=E7=9A=84=EF=BC=8C=E4=BB=A5=E4=BF=AE=E5=A4=8D=20nixos-?= =?UTF-8?q?install=20=E9=98=B6=E6=AE=B5=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes #451 --- trans.sh | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/trans.sh b/trans.sh index 71983b7..b5fd282 100644 --- a/trans.sh +++ b/trans.sh @@ -1613,11 +1613,36 @@ install_nixos() { done fi - if is_in_china; then - sh=https://mirror.nju.edu.cn/nix/latest/install + # 备用方案 + # 1. 从 https://mirror.nju.edu.cn/nix-channels/nixos-25.05/nixexprs.tar.xz 获取 + # https://github.com/NixOS/nixpkgs/blob/nixos-25.05/pkgs/tools/package-management/nix/default.nix + # https://github.com/NixOS/nixpkgs/blob/nixos-25.05/nixos/modules/installer/tools/nix-fallback-paths.nix + # 2. 安装最新版 nix,添加 nixos channel 后获取 + # nix eval -f '' --raw 'nixVersions.stable.version' --extra-experimental-features nix-command + + if true; then + # nix 版本号使用目标系统里面的 + download $mirror/nixos-$releasever/store-paths.xz /os/store-paths.xz + apk add xz + nix_ver=$(xz -dc