homelab framework module init (everything is a mess)
Some checks failed
Test / tests (push) Has been cancelled
/ OpenTofu (push) Has been cancelled

This commit is contained in:
plasmagoat 2025-07-28 02:05:13 +02:00
parent 0347f4d325
commit bcbcc8b17b
94 changed files with 7289 additions and 436 deletions

18
scripts/config.nix Normal file
View file

@ -0,0 +1,18 @@
{
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)