nixos/icingaweb2, nixos/restya-board, nixos/zoneminder: set phpOptions per phpfpm pool, instead of applying to every phpfpm pool
This commit is contained in:
parent
898870824d
commit
cddb117b96
@ -275,14 +275,14 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
phpfpm = lib.mkIf useNginx {
|
phpfpm = lib.mkIf useNginx {
|
||||||
phpOptions = ''
|
|
||||||
date.timezone = "${config.time.timeZone}"
|
|
||||||
|
|
||||||
${lib.concatStringsSep "\n" (map (e:
|
|
||||||
"extension=${e.pkg}/lib/php/extensions/${e.name}.so") phpExtensions)}
|
|
||||||
'';
|
|
||||||
pools.zoneminder = {
|
pools.zoneminder = {
|
||||||
listen = socket;
|
listen = socket;
|
||||||
|
phpOptions = ''
|
||||||
|
date.timezone = "${config.time.timeZone}"
|
||||||
|
|
||||||
|
${lib.concatStringsSep "\n" (map (e:
|
||||||
|
"extension=${e.pkg}/lib/php/extensions/${e.name}.so") phpExtensions)}
|
||||||
|
'';
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
user = ${user}
|
user = ${user}
|
||||||
group = ${group}
|
group = ${group}
|
||||||
|
@ -546,26 +546,26 @@ in {
|
|||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
services.phpfpm.poolConfigs = mkIf (cfg.pool == "${poolName}") {
|
services.phpfpm.poolConfigs = mkIf (cfg.pool == "${poolName}") {
|
||||||
"${poolName}" = ''
|
"${poolName}" = {
|
||||||
listen = "${phpfpmSocketName}"
|
listen = phpfpmSocketName;
|
||||||
listen.owner = nginx
|
phpOptions = ''
|
||||||
listen.group = nginx
|
extension = ${pkgs.phpPackages.imagick}/lib/php/extensions/imagick.so
|
||||||
listen.mode = 0600
|
date.timezone = "${cfg.timezone}"
|
||||||
user = icingaweb2
|
'';
|
||||||
pm = dynamic
|
extraConfig = ''
|
||||||
pm.max_children = 75
|
listen.owner = nginx
|
||||||
pm.start_servers = 2
|
listen.group = nginx
|
||||||
pm.min_spare_servers = 2
|
listen.mode = 0600
|
||||||
pm.max_spare_servers = 10
|
user = icingaweb2
|
||||||
'';
|
pm = dynamic
|
||||||
|
pm.max_children = 75
|
||||||
|
pm.start_servers = 2
|
||||||
|
pm.min_spare_servers = 2
|
||||||
|
pm.max_spare_servers = 10
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.phpfpm.phpOptions = mkIf (cfg.pool == "${poolName}")
|
|
||||||
''
|
|
||||||
extension = ${pkgs.phpPackages.imagick}/lib/php/extensions/imagick.so
|
|
||||||
date.timezone = "${cfg.timezone}"
|
|
||||||
'';
|
|
||||||
|
|
||||||
systemd.services."phpfpm-${poolName}".serviceConfig.ReadWritePaths = [ "/etc/icingaweb2" ];
|
systemd.services."phpfpm-${poolName}".serviceConfig.ReadWritePaths = [ "/etc/icingaweb2" ];
|
||||||
|
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
|
@ -179,34 +179,35 @@ in
|
|||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
services.phpfpm.poolConfigs = {
|
services.phpfpm.poolConfigs = {
|
||||||
"${poolName}" = ''
|
"${poolName}" = {
|
||||||
listen = "${phpfpmSocketName}";
|
listen = phpfpmSocketName;
|
||||||
listen.owner = nginx
|
phpOptions = ''
|
||||||
listen.group = nginx
|
date.timezone = "CET"
|
||||||
listen.mode = 0600
|
|
||||||
user = ${cfg.user}
|
${optionalString (!isNull cfg.email.server) ''
|
||||||
group = ${cfg.group}
|
SMTP = ${cfg.email.server}
|
||||||
pm = dynamic
|
smtp_port = ${toString cfg.email.port}
|
||||||
pm.max_children = 75
|
auth_username = ${cfg.email.login}
|
||||||
pm.start_servers = 10
|
auth_password = ${cfg.email.password}
|
||||||
pm.min_spare_servers = 5
|
''}
|
||||||
pm.max_spare_servers = 20
|
'';
|
||||||
pm.max_requests = 500
|
extraConfig = ''
|
||||||
catch_workers_output = 1
|
listen.owner = nginx
|
||||||
'';
|
listen.group = nginx
|
||||||
|
listen.mode = 0600
|
||||||
|
user = ${cfg.user}
|
||||||
|
group = ${cfg.group}
|
||||||
|
pm = dynamic
|
||||||
|
pm.max_children = 75
|
||||||
|
pm.start_servers = 10
|
||||||
|
pm.min_spare_servers = 5
|
||||||
|
pm.max_spare_servers = 20
|
||||||
|
pm.max_requests = 500
|
||||||
|
catch_workers_output = 1
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.phpfpm.phpOptions = ''
|
|
||||||
date.timezone = "CET"
|
|
||||||
|
|
||||||
${optionalString (!isNull cfg.email.server) ''
|
|
||||||
SMTP = ${cfg.email.server}
|
|
||||||
smtp_port = ${toString cfg.email.port}
|
|
||||||
auth_username = ${cfg.email.login}
|
|
||||||
auth_password = ${cfg.email.password}
|
|
||||||
''}
|
|
||||||
'';
|
|
||||||
|
|
||||||
services.nginx.enable = true;
|
services.nginx.enable = true;
|
||||||
services.nginx.virtualHosts."${cfg.virtualHost.serverName}" = {
|
services.nginx.virtualHosts."${cfg.virtualHost.serverName}" = {
|
||||||
listen = [ { addr = cfg.virtualHost.listenHost; port = cfg.virtualHost.listenPort; } ];
|
listen = [ { addr = cfg.virtualHost.listenHost; port = cfg.virtualHost.listenPort; } ];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user