aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2021-01-01 12:21:09 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2021-01-01 12:34:19 +0100
commit74a10960d8659eaffa8224cee31fcf217c69609f (patch)
treebc8719c7cfb5b74b60dfc5fbd55b4c0f8663f54c /modules
parent0ba91bdd57fd6b08f00197d65cd298c317aa164f (diff)
downloadNix-74a10960d8659eaffa8224cee31fcf217c69609f.tar.gz
Nix-74a10960d8659eaffa8224cee31fcf217c69609f.tar.zst
Nix-74a10960d8659eaffa8224cee31fcf217c69609f.zip
Use flake for openarc modules
Diffstat (limited to 'modules')
-rw-r--r--modules/private/mail/milters.nix35
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" ];