1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-31 12:07:48 +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 [
machine: string = "" # The machine to build.
...arguments # Extra arguments to pass to nixos-rebuild.
] {
mut machine_ = $machine
@ -14,15 +13,16 @@ def main [
if ($machine_ | is-empty) and ($valid_machines | length) == 1 {
$machine_ = ($valid_machines | get 0)
} else {
main "" ($arguments | str join " ")
main ""
exit
}
}
if not ($machine_ in $valid_machines) {
main "" ($arguments | str join " ")
main ""
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"
}