diff options
author | Aaron Andersen <aaron@fosslib.net> | 2019-06-28 21:47:43 -0400 |
---|---|---|
committer | Aaron Andersen <aaron@fosslib.net> | 2019-06-28 21:47:43 -0400 |
commit | 278d867a9b50e2472b1724988363b26f8eea6bf7 (patch) | |
tree | 42366eff05fcae152a48d7eaa39ed6d1762096ff /nixos/modules/services/web-apps/icingaweb2 | |
parent | 4b98e262a040f69197ad43cd4ec7f9106bf6495d (diff) |
Revert "Merge pull request #63156 from Izorkin/phpfpm-rootless"
This reverts commit b5478fd1a2ef442a54c36031bf3a27a96b5ea31c, reversing changes made to dbb00bfcbfb291e79d4d2d512041656e6bcfcd9a.
Diffstat (limited to 'nixos/modules/services/web-apps/icingaweb2')
-rw-r--r-- | nixos/modules/services/web-apps/icingaweb2/icingaweb2.nix | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/nixos/modules/services/web-apps/icingaweb2/icingaweb2.nix b/nixos/modules/services/web-apps/icingaweb2/icingaweb2.nix index e83270fda5c9a..910e1d937bf35 100644 --- a/nixos/modules/services/web-apps/icingaweb2/icingaweb2.nix +++ b/nixos/modules/services/web-apps/icingaweb2/icingaweb2.nix @@ -1,6 +1,7 @@ { config, lib, pkgs, ... }: with lib; let cfg = config.services.icingaweb2; poolName = "icingaweb2"; + phpfpmSocketName = "/var/run/phpfpm/${poolName}.sock"; defaultConfig = { global = { @@ -161,23 +162,19 @@ in { }; config = mkIf cfg.enable { - services.phpfpm.pools = mkIf (cfg.pool == "${poolName}") { - "${poolName}" = { - socketName = "${poolName}"; - phpPackage = pkgs.php; - user = "icingaweb2"; - group = "icingaweb2"; - 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 = 2 - pm.max_spare_servers = 10 - ''; - }; + services.phpfpm.poolConfigs = mkIf (cfg.pool == "${poolName}") { + "${poolName}" = '' + listen = "${phpfpmSocketName}" + listen.owner = nginx + listen.group = nginx + listen.mode = 0600 + 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}") @@ -209,7 +206,7 @@ in { include ${config.services.nginx.package}/conf/fastcgi.conf; try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_pass unix:/run/phpfpm-${poolName}/${poolName}.sock; + fastcgi_pass unix:${phpfpmSocketName}; fastcgi_param SCRIPT_FILENAME ${pkgs.icingaweb2}/public/index.php; ''; }; @@ -242,8 +239,5 @@ in { group = "icingaweb2"; isSystemUser = true; }; - users.users.nginx = { - extraGroups = [ "icingaweb2" ]; - }; }; } |