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