diff options
Diffstat (limited to 'modules/websites/php-application.nix')
-rw-r--r-- | modules/websites/php-application.nix | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/modules/websites/php-application.nix b/modules/websites/php-application.nix index 8ad7a0df..20e2a5dd 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 | ||