about summary refs log tree commit diff
path: root/pkgs/os-specific/linux/nixos-rebuild
diff options
context:
space:
mode:
authorFabian Möller <fabianm88@gmail.com>2023-01-13 10:16:46 +0100
committerFabian Möller <fabianm88@gmail.com>2023-01-13 10:16:46 +0100
commitcc4de1aa3ad39c480e111113aec48da2e7c24e8d (patch)
tree19aac8395ed6f3848829d2e39cacde23b404201a /pkgs/os-specific/linux/nixos-rebuild
parent16b20a5c98d78711d72ca8ac19edfa26b56eb3d6 (diff)
nixos-rebuild: Allow local builds when --target-host is used again
This is a followup of #148921, to allow local builds when
`--target-host` is used again. It also documents the change in
behavior, regarding the specialty of the `localhost` value.

By removing the special handling of an empty `buildHost` and non empty
`targetHost`, this change also slightly alters the behavior of
`nixos-rebuild`.

Originally by specifying `--target-host target --build-host ""`, the
now removed special case would transform those arguments to
`--target-host target --build-host target`.
Now the empty `--build-host` would result in a local build.
Diffstat (limited to 'pkgs/os-specific/linux/nixos-rebuild')
-rwxr-xr-xpkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh4
1 files changed, 0 insertions, 4 deletions
diff --git a/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh b/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh
index 217e04d35720e..ed7c9231905a3 100755
--- a/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh
+++ b/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh
@@ -148,10 +148,6 @@ if [[ -n "$SUDO_USER" || -n $remoteSudo ]]; then
     maybeSudo=(sudo --preserve-env="$preservedSudoVars" --)
 fi
 
-if [[ -z "$buildHost" && -n "$targetHost" ]]; then
-    buildHost="$targetHost"
-fi
-
 # log the given argument to stderr if verbose mode is on
 logVerbose() {
     if [ -n "$verboseScript" ]; then