Skip to content

Commit 6c03cc1

Browse files
EnzimeMangoIV
authored andcommitted
nixos-anywhere: avoid ssh-ng:// with nix copy
Fixes #347 Co-Authored-By: mangoiv <[email protected]>
1 parent 4f2fdae commit 6c03cc1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/nixos-anywhere.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,10 @@ runDisko() {
456456
elif [[ ${buildOnRemote} == "y" ]]; then
457457
step Building disko script
458458
# We need to do a nix copy first because nix build doesn't have --no-check-sigs
459-
nixCopy --to "ssh-ng://$sshConnection" "${flake}#nixosConfigurations.\"${flakeAttr}\".config.system.build.diskoScript" \
459+
# Use ssh:// here to avoid https://github.com/NixOS/nix/issues/7359
460+
nixCopy --to "ssh://$sshConnection" "${flake}#nixosConfigurations.\"${flakeAttr}\".config.system.build.diskoScript" \
460461
--derivation --no-check-sigs
462+
# If we don't use ssh-ng here, we get `error: operation 'getFSAccessor' is not supported by store`
461463
diskoScript=$(
462464
nixBuild "${flake}#nixosConfigurations.\"${flakeAttr}\".config.system.build.diskoScript" \
463465
--eval-store auto --store "ssh-ng://$sshConnection?ssh-key=$sshKeyDir/nixos-anywhere"
@@ -476,8 +478,10 @@ nixosInstall() {
476478
elif [[ ${buildOnRemote} == "y" ]]; then
477479
step Building the system closure
478480
# We need to do a nix copy first because nix build doesn't have --no-check-sigs
479-
nixCopy --to "ssh-ng://$sshConnection?remote-store=local?root=/mnt" "${flake}#nixosConfigurations.\"${flakeAttr}\".config.system.build.toplevel" \
481+
# Use ssh:// here to avoid https://github.com/NixOS/nix/issues/7359
482+
nixCopy --to "ssh://$sshConnection?remote-store=local?root=/mnt" "${flake}#nixosConfigurations.\"${flakeAttr}\".config.system.build.toplevel" \
480483
--derivation --no-check-sigs
484+
# If we don't use ssh-ng here, we get `error: operation 'getFSAccessor' is not supported by store`
481485
nixosSystem=$(
482486
nixBuild "${flake}#nixosConfigurations.\"${flakeAttr}\".config.system.build.toplevel" \
483487
--eval-store auto --store "ssh-ng://$sshConnection?ssh-key=$sshKeyDir/nixos-anywhere&remote-store=local?root=/mnt"

0 commit comments

Comments
 (0)