config/hosts.nix

22 lines
319 B
Nix

{
roles,
homelabConfig,
lib,
utils,
...
}:
lib.attrsets.mapAttrs' (
name: _:
let
cfg = import (./hosts + "/${name}") {
inherit roles;
hlConfig = homelabConfig;
};
hostname = cfg.hostname;
in
{
name = hostname;
value = utils.mkHost cfg;
}
) (builtins.readDir ./hosts)