diff --git a/devshell/commands.nix b/devshell/commands.nix index 97f138e..53dc9d3 100644 --- a/devshell/commands.nix +++ b/devshell/commands.nix @@ -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";