1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-31 12:07:48 +00:00

Start refactor

This commit is contained in:
RGBCube 2025-01-11 15:51:21 +03:00
parent 99b7ccfadb
commit 06cce18e72
155 changed files with 2139 additions and 3738 deletions

View file

@ -1,5 +1,6 @@
#!/usr/bin/env nu
# Rebuild a NixOS / Darwin configuration.
def main --wrapped [
host: string = "" # The host to build.
...arguments # The arguments to pass to `nixos-rebuild switch`.
@ -21,21 +22,27 @@ def main --wrapped [
"--option" "eval-cache" "false"
] | append ($args_split | get --ignore-errors 1 | default [])
if $host == (hostname) {
nh os switch . ...$nh_flags -- ...$nix_flags
} else {
git ls-files | (
rsync
--rsh "ssh -q"
--delete-missing-args
--compress
--files-from -
./ ($host + ":ncc")
)
if $host != (hostname) {
git ls-files
| (rsync
--rsh "ssh -q"
--delete-missing-args
--compress
--files-from -
./ ($host + ":ncc"))
ssh -q -tt $host $"
cd ncc
./rebuild.nu ($host) ($arguments | str join ' ')
"
return
}
if (uname | get kernel-name) == "Darwin" {
darwin-rebuild switch --flake (".#" + $host) ...$nix_flags
} else {
nh os switch . ...$nh_flags -- ...$nix_flags
}
}