locations: move attrset into config block
All checks were successful
flake / flake (push) Successful in 1m42s

This commit is contained in:
Jake Hillion 2024-04-28 10:39:07 +01:00
parent 745ea58dec
commit 1ca4daab9c

View File

@ -12,7 +12,12 @@ in
locations = lib.mkOption {
readOnly = true;
default = {
};
};
config = lib.mkMerge [
{
custom.locations.locations = {
services = {
authoritative_dns = [
"jorah.cx.ts.hillion.co.uk"
@ -29,10 +34,10 @@ in
unifi = "jorah.cx.ts.hillion.co.uk";
};
};
};
};
}
config = lib.mkIf cfg.autoServe {
(lib.mkIf cfg.autoServe
{
custom.services = lib.mapAttrsRecursive
(path: value: {
enable =
@ -41,5 +46,6 @@ in
else config.networking.fqdn == value;
})
cfg.locations.services;
};
})
];
}