feat(meta/dns): Add private subdomain linking to the netbird ips

This commit is contained in:
Tom Hubrecht 2024-10-30 10:35:12 +01:00
parent 45f2f59055
commit 06bbe99769
Signed by: thubrecht
SSH key fingerprint: SHA256:r+nK/SIcWlJ0zFZJGHtlAoRwq1Rm+WcKAm5ADYMoQPc

View file

@ -1,7 +1,7 @@
{ lib, dns, ... }:
let
inherit (lib) mapAttrs' nameValuePair;
inherit (lib) mapAttrs' nameValuePair optional;
inherit (lib.extra) fuseAttrs mapSingleFuse;
inherit (dns.lib.combinators) mx spf ttl;
@ -217,17 +217,19 @@ in
subdomains = mapAttrs' (
host:
{ site, ... }:
nameValuePair "${host}.${site}" (
with meta.network.${host}.addresses;
{
let
net = meta.network.${host};
inherit (net.addresses) ipv4 ipv6;
in
nameValuePair "${host}.${site}" {
A = ipv4;
AAAA = ipv6;
subdomains = {
v4.A = ipv4;
v6.AAAA = ipv6;
private.A = optional (net.netbirdIp != null) net.netbirdIp;
};
}
)
) meta.nodes;
};
};