forked from mirrors/nixpkgs
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.
This commit is contained in:
parent
707bb2712e
commit
283eaaff3e
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue