Make devshell commands to run command builds

This commit is contained in:
2022-02-19 23:57:06 +00:00
parent fafb7d4656
commit 31d21e7870
3 changed files with 30 additions and 6 deletions

View File

@@ -48,5 +48,33 @@ in
help = "Run `home-manager switch`";
command = ''home-manager switch --flake . "$@"'';
}
{
name = "build-system";
category = "tasks";
help = "Build NixOS configuration";
command = ''nix build "''${@:2}" ".#nixosConfigurations.\"$1\".config.system.build.toplevel"'';
}
{
name = "run-vm";
category = "tasks";
help = "Run NixOS configuration as a VM";
command =
''
cd "$PRJ_ROOT"
nix run ".#nixosConfigurations.\"$1\".config.my.buildAs.devVM"
'';
}
{
name = "build-iso";
category = "tasks";
help = "Build NixOS configuration into an ISO";
command = ''nix build "''${@:2}" ".#nixosConfigurations.\"$1\".config.my.buildAs.iso"'';
}
{
name = "build-home";
category = "tasks";
help = "Build home-manager configuration";
command = ''nix build "''${@:2}" ".#homeConfigurations.\"$1\".activationPackage"'';
}
];
}