homelab framework module init (everything is a mess)
This commit is contained in:
parent
0347f4d325
commit
bcbcc8b17b
94 changed files with 7289 additions and 436 deletions
18
scripts/config.nix
Normal file
18
scripts/config.nix
Normal 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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue