WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 2b62419

Browse files
committed
use installer for substituting
Also in most cases our installer will likely not be build from the same nixpkgs revision as our target system, this will still speed up things signifanctly when we don't have to upload drv files twice for `--build-on-remote`. It might also help people that have their own installer build from the same nixpkgs revision as their target system.
1 parent f9d38ca commit 2b62419

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/nixos-anywhere.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -570,16 +570,16 @@ nixosInstall() {
570570
local nixosSystem=$1
571571
if [[ -n ${nixosSystem} ]]; then
572572
step Uploading the system closure
573-
nixCopy --to "ssh://$sshConnection?remote-store=local?root=/mnt" "$nixosSystem"
573+
nixCopy --substituters / --to "ssh://$sshConnection?remote-store=local?root=/mnt" "$nixosSystem"
574574
elif [[ ${buildOnRemote} == "y" ]]; then
575575
step Building the system closure
576576
# We need to do a nix copy first because nix build doesn't have --no-check-sigs
577577
# Use ssh:// here to avoid https://github.com/NixOS/nix/issues/7359
578-
nixCopy --to "ssh://$sshConnection?remote-store=local?root=/mnt" "${flake}#${flakeAttr}.system.build.toplevel" \
578+
nixCopy --substituters / --to "ssh://$sshConnection?remote-store=local?root=/mnt" "${flake}#${flakeAttr}.system.build.toplevel" \
579579
--derivation --no-check-sigs
580580
# If we don't use ssh-ng here, we get `error: operation 'getFSAccessor' is not supported by store`
581581
nixosSystem=$(
582-
nixBuild "${flake}#${flakeAttr}.system.build.toplevel" \
582+
nixBuild --substituters / "${flake}#${flakeAttr}.system.build.toplevel" \
583583
--eval-store auto --store "ssh-ng://$sshConnection?ssh-key=$sshKeyDir/nixos-anywhere&remote-store=local?root=/mnt"
584584
)
585585
fi

0 commit comments

Comments
 (0)