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.
commit283eaaff3e54967a7c1e8edd4ca5ecda349403bb
authorfricklerhandwerk <fricklerhandwerk@users.noreply.github.com>
dateSun 27 Dec 2020, 02:16 (6 years ago)
parent707bb27
pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh+1−1
@@ -145,7 +145,7 @@ buildHostCmd() {
145145 if [ -z "$buildHost" ]; then
146146 "$@"
147147 elif [ -n "$remoteNix" ]; then
148− ssh $SSHOPTS "$buildHost" env PATH="$remoteNix:$PATH" "${maybeSudo[@]}" "$@"
148+ ssh $SSHOPTS "$buildHost" env PATH="$remoteNix":'$PATH' "${maybeSudo[@]}" "$@"
149149 else
150150 ssh $SSHOPTS "$buildHost" "${maybeSudo[@]}" "$@"
151151 fi