aboutsummaryrefslogtreecommitdiff
path: root/modules/websites/php-application.nix
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2020-03-25 11:57:48 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2020-04-03 16:25:07 +0200
commit5400b9b6f65451d41a9106fae6fc00f97d83f4ef (patch)
tree6ed072da7b1f17ac3994ffea052aa0c0822f8446 /modules/websites/php-application.nix
parent441da8aac378f401625e82caf281fa0e26128310 (diff)
downloadNix-5400b9b6f65451d41a9106fae6fc00f97d83f4ef.tar.gz
Nix-5400b9b6f65451d41a9106fae6fc00f97d83f4ef.tar.zst
Nix-5400b9b6f65451d41a9106fae6fc00f97d83f4ef.zip
Upgrade nixos
Diffstat (limited to 'modules/websites/php-application.nix')
-rw-r--r--modules/websites/php-application.nix31
1 files changed, 18 insertions, 13 deletions
diff --git a/modules/websites/php-application.nix b/modules/websites/php-application.nix
index 8ad7a0d..20e2a5d 100644
--- a/modules/websites/php-application.nix
+++ b/modules/websites/php-application.nix
@@ -44,10 +44,15 @@ in
44 description = "Name of the socket to listen to. Defaults to app name if null"; 44 description = "Name of the socket to listen to. Defaults to app name if null";
45 }; 45 };
46 phpPool = mkOption { 46 phpPool = mkOption {
47 type = lines; 47 type = attrsOf str;
48 default = ""; 48 default = {};
49 description = "Pool configuration to append"; 49 description = "Pool configuration to append";
50 }; 50 };
51 phpEnv = mkOption {
52 type = attrsOf str;
53 default = {};
54 description = "Pool environment to append";
55 };
51 phpOptions = mkOption { 56 phpOptions = mkOption {
52 type = lines; 57 type = lines;
53 default = ""; 58 default = "";
@@ -135,7 +140,7 @@ in
135 services.phpApplication.phpListenPaths = mkOption { 140 services.phpApplication.phpListenPaths = mkOption {
136 type = attrsOf path; 141 type = attrsOf path;
137 default = attrsets.mapAttrs' (name: icfg: attrsets.nameValuePair 142 default = attrsets.mapAttrs' (name: icfg: attrsets.nameValuePair
138 name "/run/phpfpm/${if icfg.phpListen == null then name else icfg.phpListen}.sock" 143 name config.services.phpfpm.pools."${name}".socket
139 ) cfg.apps; 144 ) cfg.apps;
140 readOnly = true; 145 readOnly = true;
141 description = '' 146 description = ''
@@ -162,17 +167,17 @@ in
162 167
163 services.phpfpm.pools = attrsets.mapAttrs' (name: icfg: attrsets.nameValuePair 168 services.phpfpm.pools = attrsets.mapAttrs' (name: icfg: attrsets.nameValuePair
164 name { 169 name {
165 listen = cfg.phpListenPaths."${name}"; 170 user = icfg.httpdUser;
166 extraConfig = '' 171 group = icfg.httpdUser;
167 user = ${icfg.httpdUser} 172 settings = {
168 group = ${icfg.httpdGroup} 173 "listen.owner" = icfg.httpdUser;
169 listen.owner = ${icfg.httpdUser} 174 "listen.group" = icfg.httpdGroup;
170 listen.group = ${icfg.httpdGroup} 175 "php_admin_value[open_basedir]" = builtins.concatStringsSep ":" ([icfg.app icfg.varDir] ++ icfg.phpWatchFiles ++ icfg.phpOpenbasedir);
171 ${optionalString (icfg.phpSession) '' 176 }
172 php_admin_value[session.save_path] = "${icfg.varDir}/phpSessions"''} 177 // optionalAttrs (icfg.phpSession) { "php_admin_value[session.save_path]" = "${icfg.varDir}/phpSessions"; }
173 php_admin_value[open_basedir] = "${builtins.concatStringsSep ":" ([icfg.app icfg.varDir] ++ icfg.phpWatchFiles ++ icfg.phpOpenbasedir)}" 178 // icfg.phpPool;
174 '' + icfg.phpPool;
175 phpOptions = config.services.phpfpm.phpOptions + icfg.phpOptions; 179 phpOptions = config.services.phpfpm.phpOptions + icfg.phpOptions;
180 inherit (icfg) phpEnv;
176 } 181 }
177 ) cfg.apps; 182 ) cfg.apps;
178 183