summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2022-07-11 09:45:01 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2022-07-11 09:45:01 +0200
commit4d18191fdb3adf1c330a06d446c0d466f9b3038a (patch)
tree98247873ce90c61028d84aa3265bc4e680b5be98
parente3cde575fddeb1dd60f69f86e34a4028ee6bb38f (diff)
downloadnixos-4d18191fdb3adf1c330a06d446c0d466f9b3038a.tar
nixos-4d18191fdb3adf1c330a06d446c0d466f9b3038a.tar.gz
nixos-4d18191fdb3adf1c330a06d446c0d466f9b3038a.tar.bz2
nixos-4d18191fdb3adf1c330a06d446c0d466f9b3038a.tar.xz
nixos-4d18191fdb3adf1c330a06d446c0d466f9b3038a.zip
...
-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;