···3838.br
3939.Op Fl -build-host Va host
4040.Op Fl -target-host Va host
4141-.Op Fl -use-remote-sudo
4141+.Op Fl -sudo
4242.Op Fl -no-ssh-tty
4343.br
4444.Op Fl -verbose | v
···404404is also set. This is useful when the target-host connection to cache.nixos.org
405405is faster than the connection between hosts.
406406.
407407-.It Fl -use-remote-sudo
407407+.It Fl -sudo
408408When set, nixos-rebuild prefixes activation commands that run on the
409409.Fl -target-host
410410system with
···3232imageVariant=
3333buildHost=
3434targetHost=
3535-remoteSudo=
3535+useSudo=
3636noSSHTTY=
3737verboseScript=
3838noFlake=
···170170 targetHost="$1"
171171 shift 1
172172 ;;
173173- --use-remote-sudo)
174174- remoteSudo=1
173173+ --sudo | --use-remote-sudo)
174174+ useSudo=1
175175 ;;
176176 --no-ssh-tty)
177177 noSSHTTY=1
···237237238238targetHostCmd() {
239239 local c
240240- if [[ "${useSudo:-x}" = 1 ]]; then
240240+ if [[ "${withSudo:-x}" = 1 ]]; then
241241 c=("sudo")
242242 else
243243 c=()
···256256 t="-t"
257257 fi
258258259259- if [ -n "$remoteSudo" ]; then
260260- useSudo=1 SSHOPTS="$SSHOPTS $t" targetHostCmd "$@"
259259+ if [[ -n "$useSudo" ]]; then
260260+ withSudo=1 SSHOPTS="$SSHOPTS $t" targetHostCmd "$@"
261261 else
262262 # While a tty might not be necessary, we apply it to be consistent with
263263 # sudo usage, and an experience that is more consistent with local deployment.