Nixos-rebuild: Difference between revisions
Correct position of references and categories |
Squeebly Joe (talk | contribs) m Updated --use-remote-sudo flag to newer --sudo flag |
||
| Line 40: | Line 40: | ||
<code>--build-host</code> and <code>--target-host</code> can be used simultaneously, even with different hosts. | <code>--build-host</code> and <code>--target-host</code> can be used simultaneously, even with different hosts. | ||
If you are rebuilding a remote host as a non-root user, use the <code>- | If you are rebuilding a remote host as a non-root user, use the <code>--sudo</code> option to elevate on the remote machine during the rebuilding process: | ||
< | <syntaxhighlight lang="console"> | ||
$ nixos-rebuild --target-host user@example.com - | $ nixos-rebuild --target-host user@example.com --sudo switch | ||
</ | </syntaxhighlight> | ||
To enter a password while using remote sudo, prefix the command with <code>NIX_SSHOPTS="-o RequestTTY=force"</code>, or add <code>--ask-sudo-password</code> with <code>nixos-rebuild-ng</code>. | To enter a password while using remote sudo, prefix the command with <code>NIX_SSHOPTS="-o RequestTTY=force"</code>, or add <code>--ask-sudo-password</code> with <code>nixos-rebuild-ng</code>. | ||