nixos-rebuild: default buildHost to localhost

Prior to #119540, the toplevel output was built
locally then pushed to the remote host when using
the command:

nixos-rebuild --flake <flake> --target-host remote.host

However, buildHost would default to targetHost when
only --target-host was supplied. This caused the .drv
closure to always be transferred unless --build-host=localhost
is supplied.

This change restores the previous build local default behavior.
TargetHost can still build the outputs, if explicitly mentioned:

nixos-rebuild --flake <flake> \
  --target-host remote.host \
  --build-host  remote.host
launchpad/nixpkgs/master
Jonathan Ringer 3 years ago
parent ad502ab5c5
commit 3d34fe9f2b
No known key found for this signature in database
GPG Key ID: 5C841D3CFDFEC4E0
  1. 2
      pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh

@ -26,7 +26,7 @@ upgrade=
upgrade_all=
repair=
profile=/nix/var/nix/profiles/system
buildHost=
buildHost=localhost
targetHost=
maybeSudo=()

Loading…
Cancel
Save