summary refs log tree commit diff
path: root/nixos/modules/services/mail/roundcube.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/services/mail/roundcube.nix')
-rw-r--r--nixos/modules/services/mail/roundcube.nix38
1 files changed, 20 insertions, 18 deletions
diff --git a/nixos/modules/services/mail/roundcube.nix b/nixos/modules/services/mail/roundcube.nix
index 3bc1cf807ac..bdedfa1bb70 100644
--- a/nixos/modules/services/mail/roundcube.nix
+++ b/nixos/modules/services/mail/roundcube.nix
@@ -4,6 +4,7 @@ with lib;
 
 let
   cfg = config.services.roundcube;
+  fpm = config.services.phpfpm.pools.roundcube;
 in
 {
   options.services.roundcube = {
@@ -105,7 +106,7 @@ in
             extraConfig = ''
               location ~* \.php$ {
                 fastcgi_split_path_info ^(.+\.php)(/.+)$;
-                fastcgi_pass unix:/run/phpfpm/roundcube;
+                fastcgi_pass unix:${fpm.socket};
                 include ${pkgs.nginx}/conf/fastcgi_params;
                 include ${pkgs.nginx}/conf/fastcgi.conf;
               }
@@ -120,24 +121,25 @@ in
     };
 
     services.phpfpm.pools.roundcube = {
-      listen = "/run/phpfpm/roundcube";
-      extraConfig = ''
-        listen.owner = nginx
-        listen.group = nginx
-        listen.mode = 0660
-        user = nginx
-        pm = dynamic
-        pm.max_children = 75
-        pm.start_servers = 2
-        pm.min_spare_servers = 1
-        pm.max_spare_servers = 20
-        pm.max_requests = 500
-        php_admin_value[error_log] = 'stderr'
-        php_admin_flag[log_errors] = on
-        php_admin_value[post_max_size] = 25M
-        php_admin_value[upload_max_filesize] = 25M
-        catch_workers_output = yes
+      user = "nginx";
+      phpOptions = ''
+        error_log = 'stderr'
+        log_errors = on
+        post_max_size = 25M
+        upload_max_filesize = 25M
       '';
+      settings = mapAttrs (name: mkDefault) {
+        "listen.owner" = "nginx";
+        "listen.group" = "nginx";
+        "listen.mode" = "0660";
+        "pm" = "dynamic";
+        "pm.max_children" = 75;
+        "pm.start_servers" = 2;
+        "pm.min_spare_servers" = 1;
+        "pm.max_spare_servers" = 20;
+        "pm.max_requests" = 500;
+        "catch_workers_output" = true;
+      };
     };
     systemd.services.phpfpm-roundcube.after = [ "roundcube-setup.service" ];