Refactor host entrypoints

This commit is contained in:
SebastianStork 2024-08-15 16:14:23 +02:00
parent a450e6119a
commit 13ea22656c

View file

@ -1,25 +1,23 @@
{ { inputs, self, ... }:
inputs,
self,
lib,
...
}:
let let
subdirsOf =
dir: builtins.attrNames (lib.filterAttrs (_: v: v == "directory") (builtins.readDir dir));
in
{
flake.nixosConfigurations = lib.genAttrs (subdirsOf "${self}/hosts") (
name:
inputs.nixpkgs.lib.nixosSystem {
specialArgs = { specialArgs = {
inherit inputs self; inherit inputs self;
}; };
modules = [ modulesOf = hostname: [
{ networking.hostName = name; } { networking.hostName = hostname; }
"${self}/hosts/${name}" "${self}/hosts/${hostname}"
"${self}/users/seb/@${name}" "${self}/users/seb/@${hostname}"
]; ];
} in
); {
flake.nixosConfigurations = {
north = inputs.nixpkgs.lib.nixosSystem {
inherit specialArgs;
modules = modulesOf "north";
};
inspiron = inputs.nixpkgs.lib.nixosSystem {
inherit specialArgs;
modules = modulesOf "inspiron";
};
};
} }