Start from scratch

This commit is contained in:
Christoph Hollizeck 2025-10-26 22:40:37 +01:00
parent f15630dfb1
commit fe6de112e6
Signed by: Daholli
GPG key ID: 249300664F2AF2C7
111 changed files with 428 additions and 6886 deletions

View 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;
}
];
};
}
))
];
}