From da83350a6706222f2b93e174e1b3148a5f00e8ac Mon Sep 17 00:00:00 2001 From: Yaya Date: Fri, 14 Feb 2025 14:24:55 +0100 Subject: [PATCH] Fix a bug in DKIM, DMARC and SRV records When `useOrigin` in a zone equals `true`, the {DKIM,DMARC,SRV} records are serialized as `@`, instead of - `${selector}._domainkey` for DKIM - `_dmarc` for DMARC and - `"_${service}._${proto}"` for SRV records. --- dns/types/record.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/dns/types/record.nix b/dns/types/record.nix index 60af9d4..2298080 100644 --- a/dns/types/record.nix +++ b/dns/types/record.nix @@ -39,10 +39,15 @@ let # add default values for the record type (recordType rsubt).merge [] [ { file = ""; value = rsubt.fromString data; } ] else data; - name' = let fname = rsubt.nameFixup or (n: _: n) name data'; in - if name == "@" then name - else if (hasSuffix ".@" name) then removeSuffix ".@" fname - else "${fname}."; + name' = + let + fname = rsubt.nameFixup or (n: _: n) name data'; + in + if fname == "@" + then fname + else if (hasSuffix ".@" fname) + then removeSuffix ".@" fname + else "${fname}."; rtype = rsubt.rtype; in lib.concatStringsSep " " (with data'; [ name'