From 4d18191fdb3adf1c330a06d446c0d466f9b3038a Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 11 Jul 2022 09:45:01 +0200 Subject: ... --- modules/postfix-mta-sts-resolver.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 { services.postfix-mta-sts-resolver.settings = { path = "/run/postfix-mta-sts-resolver/map.sock"; mode = 432; # 0o0660 - } // (optionalAttrs cfg.redis { cache.redis.url = "unix://${toString config.services.redis.servers.postfix-mta-sts-resolver.unixSocket}"; }); + } // (optionalAttrs cfg.redis { cache = { + type = "redis"; + options.url = "unix://${toString config.services.redis.servers.postfix-mta-sts-resolver.unixSocket}"; + }; + }); services.redis.servers.postfix-mta-sts-resolver = mkIf cfg.redis { enable = true; @@ -45,6 +49,9 @@ in { wantedBy = ["postfix.service"]; before = ["postfix.service"]; + wants = mkIf cfg.redis [ "redis-postfix-mta-sts-resolver.service" ]; + after = mkIf cfg.redis [ "redis-postfix-mta-sts-resolver.service" ]; + serviceConfig = { ExecStart = "${pkgs.postfix-mta-sts-resolver}/bin/mta-sts-daemon -v ${cfg.loglevel} -c ${pkgs.writeText "mta-sts-daemon.yml" (generators.toYAML {} cfg.settings)}"; SupplementaryGroups = mkIf cfg.redis config.services.redis.servers.postfix-mta-sts-resolver.user; -- cgit v1.2.3