summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/postfix-mta-sts-resolver.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/postfix-mta-sts-resolver.nix b/modules/postfix-mta-sts-resolver.nix
index 454f24f2..52439659 100644
--- a/modules/postfix-mta-sts-resolver.nix
+++ b/modules/postfix-mta-sts-resolver.nix
@@ -27,7 +27,11 @@ in {
27 services.postfix-mta-sts-resolver.settings = { 27 services.postfix-mta-sts-resolver.settings = {
28 path = "/run/postfix-mta-sts-resolver/map.sock"; 28 path = "/run/postfix-mta-sts-resolver/map.sock";
29 mode = 432; # 0o0660 29 mode = 432; # 0o0660
30 } // (optionalAttrs cfg.redis { cache.redis.url = "unix://${toString config.services.redis.servers.postfix-mta-sts-resolver.unixSocket}"; }); 30 } // (optionalAttrs cfg.redis { cache = {
31 type = "redis";
32 options.url = "unix://${toString config.services.redis.servers.postfix-mta-sts-resolver.unixSocket}";
33 };
34 });
31 35
32 services.redis.servers.postfix-mta-sts-resolver = mkIf cfg.redis { 36 services.redis.servers.postfix-mta-sts-resolver = mkIf cfg.redis {
33 enable = true; 37 enable = true;
@@ -45,6 +49,9 @@ in {
45 wantedBy = ["postfix.service"]; 49 wantedBy = ["postfix.service"];
46 before = ["postfix.service"]; 50 before = ["postfix.service"];
47 51
52 wants = mkIf cfg.redis [ "redis-postfix-mta-sts-resolver.service" ];
53 after = mkIf cfg.redis [ "redis-postfix-mta-sts-resolver.service" ];
54
48 serviceConfig = { 55 serviceConfig = {
49 ExecStart = "${pkgs.postfix-mta-sts-resolver}/bin/mta-sts-daemon -v ${cfg.loglevel} -c ${pkgs.writeText "mta-sts-daemon.yml" (generators.toYAML {} cfg.settings)}"; 56 ExecStart = "${pkgs.postfix-mta-sts-resolver}/bin/mta-sts-daemon -v ${cfg.loglevel} -c ${pkgs.writeText "mta-sts-daemon.yml" (generators.toYAML {} cfg.settings)}";
50 SupplementaryGroups = mkIf cfg.redis config.services.redis.servers.postfix-mta-sts-resolver.user; 57 SupplementaryGroups = mkIf cfg.redis config.services.redis.servers.postfix-mta-sts-resolver.user;