devshell: Add command to build and switch to NixOS config
This commit is contained in:
parent
5157ca2541
commit
926209d168
@ -73,6 +73,15 @@ in
|
||||
help = "Build NixOS configuration";
|
||||
command = ''nix build "''${@:2}" ".#nixosConfigurations.\"$1\".config.system.build.toplevel"'';
|
||||
}
|
||||
{
|
||||
name = "build-n-switch";
|
||||
category = "tasks";
|
||||
help = "Build NixOS configuration for the current host and run `switch-to-configuration`";
|
||||
command = ''
|
||||
path="$(nix build --no-link --print-out-paths ".#nixosConfigurations.\"$(hostname)\".config.system.build.toplevel")"
|
||||
doas "$path"/bin/switch-to-configuration "$@"
|
||||
'';
|
||||
}
|
||||
{
|
||||
name = "run-vm";
|
||||
category = "tasks";
|
||||
|
Loading…
Reference in New Issue
Block a user