From f3770d5ae4046000e42221fbb6c73e7c1f41af0c Mon Sep 17 00:00:00 2001 From: RGBCube Date: Thu, 15 May 2025 21:08:40 +0300 Subject: [PATCH] rebuild: use explicit --remote flag for remote build --- rebuild.nu | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rebuild.nu b/rebuild.nu index e835d53..fb37c56 100755 --- a/rebuild.nu +++ b/rebuild.nu @@ -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 "