refactor php-fpm pool wiring to shared phpPackage option

Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/13105350-82a0-4135-b8a4-55016f202195

Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-17 13:07:25 +00:00
committed by GitHub
parent 5324344eed
commit 539ede00cb
3 changed files with 26 additions and 36 deletions

View File

@@ -257,14 +257,13 @@ CREDS
"d /var/lib/nextcloud 0770 caddy php -" "d /var/lib/nextcloud 0770 caddy php -"
]; ];
services.phpfpm.pools.mypool.phpOptions = lib.mkAfter ''
output_buffering = 0
'';
services.phpfpm.pools.nextcloud = { services.phpfpm.pools.nextcloud = {
user = "caddy"; user = "caddy";
group = "php"; group = "php";
phpPackage = config.services.phpfpm.pools.mypool.phpPackage; phpPackage = config.sovran_systemsOS.phpPackage;
phpOptions = lib.mkAfter ''
output_buffering = 0
'';
settings = { settings = {
"pm" = "dynamic"; "pm" = "dynamic";
"pm.max_children" = 75; "pm.max_children" = 75;

View File

@@ -29,6 +29,13 @@ let
in in
{ {
options.sovran_systemsOS.phpPackage = lib.mkOption {
type = lib.types.package;
default = custom-php;
description = "Shared PHP package with all extensions for Sovran_SystemsOS services";
};
config = {
users.users = { users.users = {
php = { php = {
@@ -46,21 +53,5 @@ in
custom-php custom-php
]; ];
services.phpfpm.pools = {
mypool = {
user = "caddy";
group = "php";
phpPackage = custom-php;
settings = {
"pm" = "dynamic";
"pm.max_children" = 75;
"pm.start_servers" = 10;
"pm.min_spare_servers" = 5;
"pm.max_spare_servers" = 20;
"pm.max_requests" = 500;
"clear_env" = "no";
};
};
}; };
} }

View File

@@ -213,7 +213,7 @@ CREDS
services.phpfpm.pools.wordpress = { services.phpfpm.pools.wordpress = {
user = "caddy"; user = "caddy";
group = "php"; group = "php";
phpPackage = config.services.phpfpm.pools.mypool.phpPackage; phpPackage = config.sovran_systemsOS.phpPackage;
settings = { settings = {
"pm" = "dynamic"; "pm" = "dynamic";
"pm.max_children" = 75; "pm.max_children" = 75;