mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 20:09:07 +01:00
26 lines
597 B
Nix
26 lines
597 B
Nix
{
|
|
inputs,
|
|
self,
|
|
lib,
|
|
...
|
|
}:
|
|
let
|
|
mkHost =
|
|
hostName:
|
|
inputs.nixpkgs.lib.nixosSystem {
|
|
specialArgs = { inherit inputs self; };
|
|
modules =
|
|
(lib.singleton { networking = { inherit hostName; }; })
|
|
++ (
|
|
"${self}/hosts/${hostName}"
|
|
|> builtins.readDir
|
|
|> lib.attrNames
|
|
|> lib.filter (file: file |> lib.hasSuffix ".nix")
|
|
|> lib.map (file: "${self}/hosts/${hostName}/${file}")
|
|
);
|
|
};
|
|
in
|
|
{
|
|
flake.nixosConfigurations =
|
|
"${self}/hosts" |> self.lib.listDirectoryNames |> self.lib.genAttrs mkHost;
|
|
}
|