config/hosts.nix

22 lines
319 B
Nix
Raw Normal View History

2024-12-26 17:22:00 +01:00
{
roles,
homelabConfig,
lib,
2025-02-05 16:19:19 +01:00
utils,
2024-12-26 17:22:00 +01:00
...
}:
lib.attrsets.mapAttrs' (
name: _:
let
cfg = import (./hosts + "/${name}") {
inherit roles;
hlConfig = homelabConfig;
2024-12-26 19:20:22 +01:00
};
hostname = cfg.hostname;
in
{
name = hostname;
2025-02-05 16:19:19 +01:00
value = utils.mkHost cfg;
}
) (builtins.readDir ./hosts)