diff options
Diffstat (limited to 'modules/private')
-rw-r--r-- | modules/private/mail/milters.nix | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/modules/private/mail/milters.nix b/modules/private/mail/milters.nix index 02c35c8..96c2800 100644 --- a/modules/private/mail/milters.nix +++ b/modules/private/mail/milters.nix | |||
@@ -1,5 +1,8 @@ | |||
1 | { lib, pkgs, config, ... }: | 1 | { lib, pkgs, config, name, ... }: |
2 | { | 2 | { |
3 | imports = | ||
4 | builtins.attrValues (import ../../../lib/flake-compat.nix ../../../flakes/openarc).nixosModules; | ||
5 | |||
3 | options.myServices.mail.milters.sockets = lib.mkOption { | 6 | options.myServices.mail.milters.sockets = lib.mkOption { |
4 | type = lib.types.attrsOf lib.types.path; | 7 | type = lib.types.attrsOf lib.types.path; |
5 | default = { | 8 | default = { |
@@ -103,36 +106,6 @@ | |||
103 | ]; | 106 | ]; |
104 | }; | 107 | }; |
105 | 108 | ||
106 | services.openarc = { | ||
107 | enable = true; | ||
108 | user = "opendkim"; | ||
109 | socket = "local:${config.myServices.mail.milters.sockets.openarc}"; | ||
110 | group = config.services.postfix.group; | ||
111 | configFile = pkgs.writeText "openarc.conf" '' | ||
112 | AuthservID mail.immae.eu | ||
113 | Domain mail.immae.eu | ||
114 | KeyFile ${config.secrets.fullPaths."opendkim/eldiron.private"} | ||
115 | Mode sv | ||
116 | Selector eldiron | ||
117 | SoftwareHeader yes | ||
118 | Syslog Yes | ||
119 | ''; | ||
120 | }; | ||
121 | systemd.services.openarc.serviceConfig.Slice = "mail.slice"; | ||
122 | systemd.services.openarc.postStart = lib.optionalString | ||
123 | (lib.strings.hasPrefix "local:" config.services.openarc.socket) '' | ||
124 | while [ ! -S ${lib.strings.removePrefix "local:" config.services.openarc.socket} ]; do | ||
125 | sleep 0.5 | ||
126 | done | ||
127 | chmod g+w ${lib.strings.removePrefix "local:" config.services.openarc.socket} | ||
128 | ''; | ||
129 | services.filesWatcher.openarc = { | ||
130 | restart = true; | ||
131 | paths = [ | ||
132 | config.secrets.fullPaths."opendkim/eldiron.private" | ||
133 | ]; | ||
134 | }; | ||
135 | |||
136 | systemd.services.milter_verify_from = { | 109 | systemd.services.milter_verify_from = { |
137 | description = "Verify from milter"; | 110 | description = "Verify from milter"; |
138 | after = [ "network.target" ]; | 111 | after = [ "network.target" ]; |