Merge branch 'opendkim-settings' into 'master'

Draft: opendkim: switch to expandable settings option

See merge request simple-nixos-mailserver/nixos-mailserver!338
This commit is contained in:
Sandro 2025-03-24 07:41:06 +01:00
commit f34d2b2787

View File

@ -58,18 +58,18 @@ in
enable = true; enable = true;
selector = cfg.dkimSelector; selector = cfg.dkimSelector;
keyPath = cfg.dkimKeyDirectory; keyPath = cfg.dkimKeyDirectory;
domains = "csl:${builtins.concatStringsSep "," cfg.domains}"; domains = "csl:${lib.concatStringsSep "," cfg.domains}";
configFile = pkgs.writeText "opendkim.conf" ('' settings = {
Canonicalization ${cfg.dkimHeaderCanonicalization}/${cfg.dkimBodyCanonicalization} Canonicalization = "${cfg.dkimHeaderCanonicalization}/${cfg.dkimBodyCanonicalization}";
UMask 0002 UMask = "0002";
Socket ${dkim.socket} Socket = dkim.socket;
KeyTable file:${keyTable} KeyTable = "file:${keyTable}";
SigningTable file:${signingTable} SigningTable = "file:${signingTable}";
'' + (lib.optionalString cfg.debug '' } // lib.optionalAttrs cfg.debug {
Syslog yes Syslog = "yes";
SyslogSuccess yes SyslogSuccess = "yes";
LogWhy yes LogWhy = "yes";
'')); };
}; };
users.users = optionalAttrs (config.services.postfix.user == "postfix") { users.users = optionalAttrs (config.services.postfix.user == "postfix") {