mirror of
https://github.com/RGBCube/ncc
synced 2025-07-29 11:07:44 +00:00
rebuild: use explicit --remote flag for remote build
This commit is contained in:
parent
5ebd45f852
commit
f3770d5ae4
1 changed files with 6 additions and 2 deletions
|
@ -13,15 +13,19 @@ def --wrapped sync [...arguments] {
|
||||||
# Rebuild a NixOS / Darwin config.
|
# Rebuild a NixOS / Darwin config.
|
||||||
def main --wrapped [
|
def main --wrapped [
|
||||||
host: string = "" # The host to build.
|
host: string = "" # The host to build.
|
||||||
...arguments # The arguments to pass to `nixos-rebuild switch`.
|
--remote (-r) # Whether if this is a remote host. The config will be built on this host if it is.
|
||||||
|
...arguments # The arguments to pass to `nh {os,darwin} switch` and `nix` (separated by --).
|
||||||
]: nothing -> nothing {
|
]: nothing -> nothing {
|
||||||
let host = if ($host | is-not-empty) {
|
let host = if ($host | is-not-empty) {
|
||||||
$host
|
$host
|
||||||
|
} else if $remote {
|
||||||
|
print $"(ansi red_bold)error:(ansi reset) hostname not specified for remote build"
|
||||||
|
exit 1
|
||||||
} else {
|
} else {
|
||||||
(hostname)
|
(hostname)
|
||||||
}
|
}
|
||||||
|
|
||||||
if $host != (hostname) {
|
if $remote {
|
||||||
ssh -tt $host $"
|
ssh -tt $host $"
|
||||||
rm -rf ncc
|
rm -rf ncc
|
||||||
"
|
"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue