feat: switch to automatic nixosConfiguration population
This commit is contained in:
parent
4c89c45e3e
commit
8331aa846f
3 changed files with 59 additions and 8 deletions
20
hosts/default.nix
Normal file
20
hosts/default.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{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.mapAttrs (host: hostConfig: lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = hostConfig;
|
||||
specialArgs = { inherit inputs; };
|
||||
}) hosts;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue