nixos-rebuild: fix --use-remote-sudo
Currently fails with:
$ nixos-rebuild test --target-host myhost --use-remote-sudo
building Nix...
sudo: /run/current-system/sw/bin/sudo must be owned by uid 0 and have the setuid bit set
It seems setting an explicit PATH in the ssh command overrides the
remote setuid wrappers.
commit35a8d78e44d566d6d2ddba42ae5137f7a511a090
authorrnhmjoj <rnhmjoj@inventati.org>
dateFri 18 Jun 2021, 02:50 (5 years ago)
parent6a8843c
pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh+1−1
@@ -139,7 +139,7 @@ buildHostCmd() {
139139 if [ -z "$buildHost" ]; then
140140 "$@"
141141 elif [ -n "$remoteNix" ]; then
142− ssh $SSHOPTS "$buildHost" env PATH="$remoteNix":'$PATH' "${maybeSudo[@]}" "$@"
142+ ssh $SSHOPTS "$buildHost" "${maybeSudo[@]}" env PATH="$remoteNix":'$PATH' "$@"
143143 else
144144 ssh $SSHOPTS "$buildHost" "${maybeSudo[@]}" "$@"
145145 fi