1
Fork 0
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:
RGBCube 2025-05-15 21:08:40 +03:00
parent 5ebd45f852
commit f3770d5ae4
Signed by: RGBCube
SSH key fingerprint: SHA256:CzqbPcfwt+GxFYNnFVCqoN5Itn4YFrshg1TrnACpA5M

View file

@ -13,15 +13,19 @@ def --wrapped sync [...arguments] {
# Rebuild a NixOS / Darwin config.
def main --wrapped [
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 {
let host = if ($host | is-not-empty) {
$host
} else if $remote {
print $"(ansi red_bold)error:(ansi reset) hostname not specified for remote build"
exit 1
} else {
(hostname)
}
if $host != (hostname) {
if $remote {
ssh -tt $host $"
rm -rf ncc
"