feat: switch to automatic nixosConfiguration population
This commit is contained in:
parent
4c89c45e3e
commit
6b8b00469e
2 changed files with 25 additions and 8 deletions
21
hosts/default.nix
Normal file
21
hosts/default.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{inputs, self, ...}:
|
||||
let
|
||||
inherit (inputs.nixpkgs) lib;
|
||||
isDirectory = _name: type: type == "directory";
|
||||
hostNames = builtins.attrNames (
|
||||
lib.filterAttrs isDirectory (builtins.readDir ./.)
|
||||
);
|
||||
hosts = lib.genAttrs hostNames (name: {
|
||||
imports = [
|
||||
(./. + "/${name}")
|
||||
];
|
||||
});
|
||||
in
|
||||
{
|
||||
|
||||
nixosConfigurations = lib.map (host: lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = host;
|
||||
specialArgs = { inherit inputs; };
|
||||
}) (builtins.attrValues hosts);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue