summary refs log tree commit diff
path: root/pkgs/os-specific/linux
diff options
context:
space:
mode:
authorfricklerhandwerk <fricklerhandwerk@users.noreply.github.com>2020-12-27 02:16:19 +0100
committerCole Helbling <cole.e.helbling@outlook.com>2021-02-10 23:13:37 -0800
commit283eaaff3e54967a7c1e8edd4ca5ecda349403bb (patch)
tree4cbffeab9241c8c167eff0609c49673e53ed217b /pkgs/os-specific/linux
parent707bb2712ef36e798c46a4b07213dc3703c93617 (diff)
downloadnixpkgs-283eaaff3e54967a7c1e8edd4ca5ecda349403bb.tar
nixpkgs-283eaaff3e54967a7c1e8edd4ca5ecda349403bb.tar.gz
nixpkgs-283eaaff3e54967a7c1e8edd4ca5ecda349403bb.tar.bz2
nixpkgs-283eaaff3e54967a7c1e8edd4ca5ecda349403bb.tar.lz
nixpkgs-283eaaff3e54967a7c1e8edd4ca5ecda349403bb.tar.xz
nixpkgs-283eaaff3e54967a7c1e8edd4ca5ecda349403bb.tar.zst
nixpkgs-283eaaff3e54967a7c1e8edd4ca5ecda349403bb.zip
nixos-rebuild: use remote $PATH in buildHostCmd
this fixes the issue when using

    nixos-rebuild switch --target-host <target> --use-remote-sudo

when the local machine does not have anything in `$PATH` that would
resolve to `sudo` on the remote machine.

the single quotes prevent expansion of `$PATH` on the local machine,
such that the remote machine's value of that variable is used.
Diffstat (limited to 'pkgs/os-specific/linux')
-rw-r--r--pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh b/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh
index cc72e2e42b4..38b5e3241c1 100644
--- a/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh
+++ b/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh
@@ -145,7 +145,7 @@ buildHostCmd() {
     if [ -z "$buildHost" ]; then
         "$@"
     elif [ -n "$remoteNix" ]; then
-        ssh $SSHOPTS "$buildHost" env PATH="$remoteNix:$PATH" "${maybeSudo[@]}" "$@"
+        ssh $SSHOPTS "$buildHost" env PATH="$remoteNix":'$PATH' "${maybeSudo[@]}" "$@"
     else
         ssh $SSHOPTS "$buildHost" "${maybeSudo[@]}" "$@"
     fi