Make devshell commands to run command builds
This commit is contained in:
parent
fafb7d4656
commit
31d21e7870
@ -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"'';
|
||||
}
|
||||
];
|
||||
}
|
||||
|
@ -113,23 +113,18 @@
|
||||
nixosModules = inlineModules modules;
|
||||
homeModules = inlineModules homeModules;
|
||||
|
||||
# TODO: Cleanup and possibly even turn into modules?
|
||||
nixosConfigurations = import ./nixos {
|
||||
inherit lib pkgsFlakes hmFlakes inputs;
|
||||
pkgs' = configPkgs';
|
||||
modules = attrValues modules;
|
||||
homeModules = attrValues homeModules;
|
||||
};
|
||||
systems = mapAttrs (_: system: system.config.system.build.toplevel) self.nixosConfigurations;
|
||||
vms = mapAttrs (_: system: system.config.my.buildAs.devVM) self.nixosConfigurations;
|
||||
isos = mapAttrs (_: system: system.config.my.buildAs.iso) self.nixosConfigurations;
|
||||
|
||||
homeConfigurations = import ./home-manager {
|
||||
inherit lib hmFlakes inputs;
|
||||
pkgs' = configPkgs';
|
||||
modules = attrValues homeModules;
|
||||
};
|
||||
homes = mapAttrs (_: home: home.activationPackage) self.homeConfigurations;
|
||||
|
||||
deploy = {
|
||||
nodes = filterAttrs (_: n: n != null)
|
||||
|
@ -17,9 +17,10 @@ in
|
||||
# Whatever installer mechanism is chosen will provied an appropriate `/`
|
||||
tmproot.enable = false;
|
||||
firewall.nat.enable = false;
|
||||
server.enable = true;
|
||||
deploy.enable = false;
|
||||
user.enable = false;
|
||||
|
||||
server.enable = true;
|
||||
};
|
||||
|
||||
environment.sessionVariables = {
|
||||
|
Loading…
Reference in New Issue
Block a user