feat(meta/dns): Add private subdomain linking to the netbird ips
This commit is contained in:
parent
45f2f59055
commit
06bbe99769
1 changed files with 14 additions and 12 deletions
26
meta/dns.nix
26
meta/dns.nix
|
@ -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;
|
||||||
A = ipv4;
|
in
|
||||||
AAAA = ipv6;
|
nameValuePair "${host}.${site}" {
|
||||||
subdomains = {
|
A = ipv4;
|
||||||
v4.A = ipv4;
|
AAAA = ipv6;
|
||||||
v6.AAAA = ipv6;
|
subdomains = {
|
||||||
};
|
v4.A = ipv4;
|
||||||
}
|
v6.AAAA = ipv6;
|
||||||
)
|
private.A = optional (net.netbirdIp != null) net.netbirdIp;
|
||||||
|
};
|
||||||
|
}
|
||||||
) meta.nodes;
|
) meta.nodes;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue