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