summary refs log tree commit diff
path: root/nixos/modules/services/mail
diff options
context:
space:
mode:
authorIzorkin <izorkin@elven.pw>2019-06-15 15:22:36 +0300
committerIzorkin <izorkin@elven.pw>2019-06-16 12:33:51 +0300
commit59a33f25e54a05b0be4f772073b7dec660e94c04 (patch)
tree5e72901363e2f8413824d140e1a2b35211593ed7 /nixos/modules/services/mail
parent320e8ab5d7ee8a04011cb19a7ac15cdd2525d59a (diff)
downloadnixpkgs-59a33f25e54a05b0be4f772073b7dec660e94c04.tar
nixpkgs-59a33f25e54a05b0be4f772073b7dec660e94c04.tar.gz
nixpkgs-59a33f25e54a05b0be4f772073b7dec660e94c04.tar.bz2
nixpkgs-59a33f25e54a05b0be4f772073b7dec660e94c04.tar.lz
nixpkgs-59a33f25e54a05b0be4f772073b7dec660e94c04.tar.xz
nixpkgs-59a33f25e54a05b0be4f772073b7dec660e94c04.tar.zst
nixpkgs-59a33f25e54a05b0be4f772073b7dec660e94c04.zip
nixos/roundcube: fix work with phpfpm-rootless mode
Diffstat (limited to 'nixos/modules/services/mail')
-rw-r--r--nixos/modules/services/mail/roundcube.nix42
1 files changed, 23 insertions, 19 deletions
diff --git a/nixos/modules/services/mail/roundcube.nix b/nixos/modules/services/mail/roundcube.nix
index e8b2e11bf72..12837f7efe7 100644
--- a/nixos/modules/services/mail/roundcube.nix
+++ b/nixos/modules/services/mail/roundcube.nix
@@ -105,7 +105,7 @@ in
             extraConfig = ''
               location ~* \.php$ {
                 fastcgi_split_path_info ^(.+\.php)(/.+)$;
-                fastcgi_pass unix:/run/phpfpm/roundcube;
+                fastcgi_pass unix:/run/phpfpm-roundcube/roundcube.sock;
                 include ${pkgs.nginx}/conf/fastcgi_params;
                 include ${pkgs.nginx}/conf/fastcgi.conf;
               }
@@ -119,24 +119,28 @@ in
       enable = true;
     };
 
-    services.phpfpm.poolConfigs.roundcube = ''
-      listen = /run/phpfpm/roundcube
-      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
-    '';
+    services.phpfpm.pools.roundcube = {
+      socketName = "roundcube";
+      phpPackage = pkgs.php;
+      user = "${config.services.nginx.user}";
+      group = "${config.services.nginx.group}";
+      extraConfig = ''
+        listen.owner = ${config.services.nginx.user}
+        listen.group = ${config.services.nginx.group}
+        listen.mode = 0600
+        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
+      '';
+    };
     systemd.services.phpfpm-roundcube.after = [ "roundcube-setup.service" ];
 
     systemd.services.roundcube-setup = let