Start from scratch
This commit is contained in:
parent
f15630dfb1
commit
fe6de112e6
111 changed files with 428 additions and 6886 deletions
37
modules/flake-parts/host-machines.nix
Normal file
37
modules/flake-parts/host-machines.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
inputs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
prefix = "hosts/";
|
||||
collectHostsModules = modules: lib.filterAttrs (name: _: lib.hasPrefix prefix name) modules;
|
||||
in
|
||||
{
|
||||
flake.nixosConfigurations = lib.pipe (collectHostsModules config.flake.modules.nixos) [
|
||||
(lib.mapAttrs' (
|
||||
name: module:
|
||||
let
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
hostConfig = module // {
|
||||
name = lib.removePrefix prefix name;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
name = lib.removePrefix prefix name;
|
||||
value = inputs.nixpkgs.lib.nixosSystem {
|
||||
inherit specialArgs;
|
||||
modules = module.imports ++ [
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.extraSpecialArgs = specialArgs;
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
))
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue