nixos-config/zones/rebmit.link.nix

58 lines
1.3 KiB
Nix
Raw Permalink Normal View History

2024-12-15 22:33:35 +08:00
{ dns, lib, ... }:
with dns.lib.combinators;
let
common = import ./common.nix;
inherit (common) hosts;
publicHosts = lib.filterAttrs (_name: value: value.endpoints != [ ]) hosts;
enthalpyHosts = lib.filterAttrs (_name: value: value.enthalpy_node_address != null) hosts;
2024-12-15 22:33:35 +08:00
in
dns.lib.toString "rebmit.link" {
inherit (common)
TTL
SOA
NS
DKIM
DMARC
2024-12-15 22:33:35 +08:00
;
MX = with mx; [ (mx 10 "suwako-vie1.rebmit.link.") ];
TXT = [ (with spf; soft [ "mx" ]) ];
subdomains =
lib.recursiveUpdate
(lib.listToAttrs (
lib.mapAttrsToList (
name: value:
lib.nameValuePair name {
A = value.endpoints_v4;
AAAA = value.endpoints_v6;
HTTPS = [
{
alpn = [
"h3"
"h2"
];
}
];
}
) publicHosts
++ lib.mapAttrsToList (
name: value:
lib.nameValuePair "${name}.enta" {
AAAA = [ value.enthalpy_node_address ];
}
) enthalpyHosts
))
{
"suwako-vie1".DMARC = [
{
p = "reject";
sp = "reject";
pct = 100;
adkim = "relaxed";
aspf = "strict";
fo = [ "1" ];
ri = 604800;
}
2024-12-15 22:33:35 +08:00
];
};
2024-12-15 22:33:35 +08:00
}