From 7af679269d91f666d5ef0160490f18f203abc85c Mon Sep 17 00:00:00 2001 From: Michael Hoang Date: Sat, 5 Jul 2025 16:28:31 +1000 Subject: [PATCH 1/2] nixos-anywhere: remove unnecessary `nix copy --derivation` --- src/nixos-anywhere.sh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/nixos-anywhere.sh b/src/nixos-anywhere.sh index 2ee38a74..ca3185c9 100755 --- a/src/nixos-anywhere.sh +++ b/src/nixos-anywhere.sh @@ -711,11 +711,6 @@ runDisko() { nixCopy --to "ssh://$sshConnection?$sshStoreSettings" "$diskoScript" elif [[ ${buildOn} == "remote" ]]; then step Building disko script - # We need to do a nix copy first because nix build doesn't have --no-check-sigs - # Use ssh:// here to avoid https://github.com/NixOS/nix/issues/7359 - nixCopy --to "ssh://$sshConnection?$sshStoreSettings" "${flake}#${flakeAttr}.system.build.${diskoMode}Script" \ - --derivation --no-check-sigs - # If we don't use ssh-ng here, we get `error: operation 'getFSAccessor' is not supported by store` diskoScript=$( nixBuild "${flake}#${flakeAttr}.system.build.${diskoAttr}" \ --eval-store auto --store "ssh-ng://$sshConnection?ssh-key=$tempDir%2Fnixos-anywhere&$sshStoreSettings" @@ -733,11 +728,6 @@ nixosInstall() { nixCopy --to "ssh://$sshConnection?remote-store=local%3Froot=%2Fmnt&$sshStoreSettings" "$nixosSystem" elif [[ ${buildOn} == "remote" ]]; then step Building the system closure - # We need to do a nix copy first because nix build doesn't have --no-check-sigs - # Use ssh:// here to avoid https://github.com/NixOS/nix/issues/7359 - nixCopy --to "ssh://$sshConnection?remote-store=local%3Froot=%2Fmnt&$sshStoreSettings" "${flake}#${flakeAttr}.system.build.toplevel" \ - --derivation --no-check-sigs - # If we don't use ssh-ng here, we get `error: operation 'getFSAccessor' is not supported by store` nixosSystem=$( nixBuild "${flake}#${flakeAttr}.system.build.toplevel" \ --eval-store auto --store "ssh-ng://$sshConnection?ssh-key=$tempDir%2Fnixos-anywhere&remote-store=local%3Froot=%2Fmnt&$sshStoreSettings" From f14e1e4b7ee6c33bf8325bc61f4e8268adc345d9 Mon Sep 17 00:00:00 2001 From: Michael Hoang Date: Sat, 5 Jul 2025 16:41:27 +1000 Subject: [PATCH 2/2] nixos-anywhere: use SSH store compression to speed up installation --- src/nixos-anywhere.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nixos-anywhere.sh b/src/nixos-anywhere.sh index ca3185c9..5269ff48 100755 --- a/src/nixos-anywhere.sh +++ b/src/nixos-anywhere.sh @@ -6,7 +6,7 @@ flake="" flakeAttr="" kexecUrl="" kexecExtraFlags="" -sshStoreSettings="" +sshStoreSettings="compress=true" enableDebug="" nixBuildFlags=() diskoAttr=""