1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-08-01 12:37:46 +00:00

Fix nom call in rebuild.nu

This commit is contained in:
RGBCube 2023-11-20 16:01:58 +03:00
parent f9885d454c
commit c5e46326de
No known key found for this signature in database

View file

@ -2,7 +2,6 @@
def main [ def main [
machine: string = "" # The machine to build. machine: string = "" # The machine to build.
...arguments # Extra arguments to pass to nixos-rebuild.
] { ] {
mut machine_ = $machine mut machine_ = $machine
@ -14,15 +13,16 @@ def main [
if ($machine_ | is-empty) and ($valid_machines | length) == 1 { if ($machine_ | is-empty) and ($valid_machines | length) == 1 {
$machine_ = ($valid_machines | get 0) $machine_ = ($valid_machines | get 0)
} else { } else {
main "" ($arguments | str join " ") main ""
exit exit
} }
} }
if not ($machine_ in $valid_machines) { if not ($machine_ in $valid_machines) {
main "" ($arguments | str join " ") main ""
exit exit
} }
sudo nixos-rebuild switch --log-format internal-json --impure --flake (".#" + $machine) ($arguments | str join ' ') | nom --json sudo --validate
sh -c $"sudo nixos-rebuild switch --log-format internal-json --impure --flake ('.#' + $machine) |& nom --json"
} }