18 lines
642 B
Nix
18 lines
642 B
Nix
{
|
|
nodes,
|
|
lib,
|
|
...
|
|
}: let
|
|
extractGlobal = name: node:
|
|
if node ? config.homelab.global
|
|
then {
|
|
${name} = {
|
|
hostname = node.config.homelab.global.hostname;
|
|
monitoring = map (e: "${e.name}:${toString e.port}") node.config.homelab.global.monitoring.endpoints;
|
|
backups = map (b: "${b.name}(${b.backend})") node.config.homelab.global.backups.jobs;
|
|
proxy = map (p: "${p.subdomain}.${node.config.homelab.global.domain}") node.config.homelab.global.reverseProxy.entries;
|
|
};
|
|
}
|
|
else {};
|
|
in
|
|
lib.foldl (acc: name: acc // (extractGlobal name nodes.${name})) {} (builtins.attrNames nodes)
|