feat: rebuild optional targets
This commit is contained in:
@@ -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"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user