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 {
|
||||
pools.zoneminder = {
|
||||
listen = socket;
|
||||
phpOptions = ''
|
||||
date.timezone = "${config.time.timeZone}"
|
||||
|
||||
${lib.concatStringsSep "\n" (map (e:
|
||||
"extension=${e.pkg}/lib/php/extensions/${e.name}.so") phpExtensions)}
|
||||
'';
|
||||
pools.zoneminder = {
|
||||
listen = socket;
|
||||
extraConfig = ''
|
||||
user = ${user}
|
||||
group = ${group}
|
||||
|
@ -546,8 +546,13 @@ in {
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.phpfpm.poolConfigs = mkIf (cfg.pool == "${poolName}") {
|
||||
"${poolName}" = ''
|
||||
listen = "${phpfpmSocketName}"
|
||||
"${poolName}" = {
|
||||
listen = phpfpmSocketName;
|
||||
phpOptions = ''
|
||||
extension = ${pkgs.phpPackages.imagick}/lib/php/extensions/imagick.so
|
||||
date.timezone = "${cfg.timezone}"
|
||||
'';
|
||||
extraConfig = ''
|
||||
listen.owner = nginx
|
||||
listen.group = nginx
|
||||
listen.mode = 0600
|
||||
@ -559,12 +564,7 @@ in {
|
||||
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" ];
|
||||
|
||||
|
@ -179,8 +179,19 @@ in
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
services.phpfpm.poolConfigs = {
|
||||
"${poolName}" = ''
|
||||
listen = "${phpfpmSocketName}";
|
||||
"${poolName}" = {
|
||||
listen = phpfpmSocketName;
|
||||
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}
|
||||
''}
|
||||
'';
|
||||
extraConfig = ''
|
||||
listen.owner = nginx
|
||||
listen.group = nginx
|
||||
listen.mode = 0600
|
||||
@ -195,17 +206,7 @@ in
|
||||
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.virtualHosts."${cfg.virtualHost.serverName}" = {
|
||||
|
Loading…
Reference in New Issue
Block a user