@@ -443,6 +443,12 @@ nixBuild() {
443
443
" $@ "
444
444
}
445
445
446
+ nixFlakeArchive () {
447
+ NIX_SSHOPTS=" ${sshArgs[*]} " nix flake archive \
448
+ " ${nixOptions[@]} " \
449
+ " $@ "
450
+ }
451
+
446
452
runVmTest () {
447
453
if [[ -z ${flakeAttr} ]]; then
448
454
echo " --vm-test is not supported with --store-paths" >&2
@@ -711,10 +717,7 @@ runDisko() {
711
717
nixCopy --to " ssh://$sshConnection ?$sshStoreSettings " " $diskoScript "
712
718
elif [[ ${buildOn} == " remote" ]]; then
713
719
step Building disko script
714
- # We need to do a nix copy first because nix build doesn't have --no-check-sigs
715
- # Use ssh:// here to avoid https://github.com/NixOS/nix/issues/7359
716
- nixCopy --to " ssh://$sshConnection ?$sshStoreSettings " " ${flake} #${flakeAttr} .system.build.${diskoMode} Script" \
717
- --derivation --no-check-sigs
720
+ nixFlakeArchive --to " ssh-ng://$sshConnection ?ssh-key=$tempDir %2Fnixos-anywhere&$sshStoreSettings " " ${flake} "
718
721
# If we don't use ssh-ng here, we get `error: operation 'getFSAccessor' is not supported by store`
719
722
diskoScript=$(
720
723
nixBuild " ${flake} #${flakeAttr} .system.build.${diskoAttr} " \
@@ -733,10 +736,7 @@ nixosInstall() {
733
736
nixCopy --to " ssh://$sshConnection ?remote-store=local%3Froot=%2Fmnt&$sshStoreSettings " " $nixosSystem "
734
737
elif [[ ${buildOn} == " remote" ]]; then
735
738
step Building the system closure
736
- # We need to do a nix copy first because nix build doesn't have --no-check-sigs
737
- # Use ssh:// here to avoid https://github.com/NixOS/nix/issues/7359
738
- nixCopy --to " ssh://$sshConnection ?remote-store=local%3Froot=%2Fmnt&$sshStoreSettings " " ${flake} #${flakeAttr} .system.build.toplevel" \
739
- --derivation --no-check-sigs
739
+ nixFlakeArchive --to " ssh-ng://$sshConnection ?remote-store=local%3Froot=%2Fmnt&ssh-key=$tempDir %2Fnixos-anywhere&$sshStoreSettings " " ${flake} "
740
740
# If we don't use ssh-ng here, we get `error: operation 'getFSAccessor' is not supported by store`
741
741
nixosSystem=$(
742
742
nixBuild " ${flake} #${flakeAttr} .system.build.toplevel" \
0 commit comments