summary refs log tree commit diff
path: root/nixos/modules/services/mail
diff options
context:
space:
mode:
authorBrian Olsen <brian@maven-group.org>2018-11-06 00:32:14 +0100
committerBrian Olsen <brian@maven-group.org>2018-11-06 00:32:14 +0100
commit46ef075e7daad1bcaab1d4d1258c7d6c64a87b63 (patch)
tree0d08f366f0d0f6c78aafd87eb33fafea7b0186e7 /nixos/modules/services/mail
parent3a4459a30508419f2498bbcbf85782dabf0178df (diff)
downloadnixpkgs-46ef075e7daad1bcaab1d4d1258c7d6c64a87b63.tar
nixpkgs-46ef075e7daad1bcaab1d4d1258c7d6c64a87b63.tar.gz
nixpkgs-46ef075e7daad1bcaab1d4d1258c7d6c64a87b63.tar.bz2
nixpkgs-46ef075e7daad1bcaab1d4d1258c7d6c64a87b63.tar.lz
nixpkgs-46ef075e7daad1bcaab1d4d1258c7d6c64a87b63.tar.xz
nixpkgs-46ef075e7daad1bcaab1d4d1258c7d6c64a87b63.tar.zst
nixpkgs-46ef075e7daad1bcaab1d4d1258c7d6c64a87b63.zip
nixos/rspamd: Add defaults for rspamd_proxy worker
Diffstat (limited to 'nixos/modules/services/mail')
-rw-r--r--nixos/modules/services/mail/rspamd.nix30
1 files changed, 16 insertions, 14 deletions
diff --git a/nixos/modules/services/mail/rspamd.nix b/nixos/modules/services/mail/rspamd.nix
index 78d2e7c262b..3489227f083 100644
--- a/nixos/modules/services/mail/rspamd.nix
+++ b/nixos/modules/services/mail/rspamd.nix
@@ -58,7 +58,7 @@ let
       };
       type = mkOption {
         type = types.nullOr (types.enum [
-          "normal" "controller" "fuzzy_storage" "proxy" "lua"
+          "normal" "controller" "fuzzy_storage" "rspamd_proxy" "lua"
         ]);
         description = "The type of this worker";
       };
@@ -99,19 +99,21 @@ let
         description = "Additional entries to put verbatim into worker section of rspamd config file.";
       };
     };
-    config = mkIf (name == "normal" || name == "controller" || name == "fuzzy") {
+    config = mkIf (name == "normal" || name == "controller" || name == "fuzzy" || name == "rspamd_proxy") {
       type = mkDefault name;
-      includes = mkDefault [ "$CONFDIR/worker-${name}.inc" ];
-      bindSockets = mkDefault (if name == "normal"
-        then [{
-              socket = "/run/rspamd/rspamd.sock";
-              mode = "0660";
-              owner = cfg.user;
-              group = cfg.group;
-            }]
-        else if name == "controller"
-        then [ "localhost:11334" ]
-        else [] );
+      includes = mkDefault [ "$CONFDIR/worker-${if name == "rspamd_proxy" then "proxy" else name}.inc" ];
+      bindSockets =
+        let
+          unixSocket = name: {
+            mode = "0660";
+            socket = "/run/rspamd/${name}.sock";
+            owner = cfg.user;
+            group = cfg.group;
+          };
+        in mkDefault (if name == "normal" then [(unixSocket "rspamd")]
+          else if name == "controller" then [ "localhost:11334" ]
+          else if name == "rspamd_proxy" then [ (unixSocket "proxy") ]
+          else [] );
     };
   };
 
@@ -284,7 +286,7 @@ in
         description = ''
           User to use when no root privileges are required.
         '';
-       };
+      };
 
       group = mkOption {
         type = types.string;