@@ -114,6 +114,21 @@ in {
114114 '';
115115 };
116116
117+ poolConfig = mkOption {
118+ type = types.lines;
119+ default = ''
120+ pm = dynamic
121+ pm.max_children = 32
122+ pm.start_servers = 2
123+ pm.min_spare_servers = 2
124+ pm.max_spare_servers = 4
125+ pm.max_requests = 500
126+ '';
127+ description = ''
128+ Options for nextcloud's PHP pool. See the documentation on <literal>php-fpm.conf</literal> for details on configuration directives.
129+ '';
130+ };
131+
117132 config = {
118133 dbtype = mkOption {
119134 type = types.enum [ "sqlite" "pgsql" "mysql" ];
@@ -339,11 +354,7 @@ in {
339354 listen.group = nginx
340355 user = nextcloud
341356 group = nginx
342− pm = dynamic
343− pm.max_children = 32
344− pm.start_servers = 2
345− pm.min_spare_servers = 2
346− pm.max_spare_servers = 4
357+ ${cfg.poolConfig}
347358 env[NEXTCLOUD_CONFIG_DIR] = ${cfg.home}/config
348359 env[PATH] = /run/wrappers/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/usr/bin:/bin
349360 ${phpAdminValues}