feat: rebuild optional targets

This commit is contained in:
Greg Hellings
2026-06-24 12:49:32 -05:00
parent b324ee5352
commit 1c7e2ff268
+3 -3
View File
@@ -12,15 +12,15 @@ def --env unlock [] {
} }
} }
def rebuild [] { def rebuild [ $target: string = "switch" ] {
if (uname | get operating-system) == "Darwin" { if (uname | get operating-system) == "Darwin" {
sudo darwin-rebuild switch sudo darwin-rebuild $target
} else { } else {
let hostname = uname | get nodename let hostname = uname | get nodename
let build = ^nom build --keep-going $"/etc/nixos#nixosConfigurations.($hostname).config.system.build.toplevel" let build = ^nom build --keep-going $"/etc/nixos#nixosConfigurations.($hostname).config.system.build.toplevel"
if $env.LAST_EXIT_CODE == 0 { if $env.LAST_EXIT_CODE == 0 {
nvd diff /run/current-system result nvd diff /run/current-system result
run0 result/bin/switch-to-configuration switch run0 result/bin/switch-to-configuration $target
} else { } else {
print "Error during build" print "Error during build"
} }