Add flag to nixos-rebuild

In the case we need sudo for the remote target, the flag
`--use-remote-sudo` must be passed if the target's ssh user is not root.

If target's ssh user is root, it doesn't hurt to use sudo.
This commit is contained in:
Martin Potier 2020-11-20 17:04:30 +02:00
parent 5ea125514e
commit b83fd5c682
No known key found for this signature in database
GPG Key ID: D4DD957DBA4AD89E
1 changed files with 2 additions and 0 deletions

View File

@ -80,6 +80,8 @@ in
] ++ lib.optionals (buildTarget' != target') [
"--build-host" "${buildTarget'.user}@${buildTarget'.host}"
"--target-host" "${target'.user}@${target'.host}"
] ++ lib.optionals target'.sudo [
"--use-remote-sudo"
]) buildTarget'}
'';