aboutsummaryrefslogtreecommitdiff
path: root/nixops/modules/websites/phpfpm/default.nix
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-04-21 19:31:06 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-04-21 19:31:06 +0200
commit8eded9ecb6220bb26599419a4aaea1743d3d187e (patch)
tree45538fcc9fa3bc9476311c14af8d399b25110a2b /nixops/modules/websites/phpfpm/default.nix
parent43fe68fb9fc66bda710974fe2a1a3321aa853303 (diff)
downloadNix-8eded9ecb6220bb26599419a4aaea1743d3d187e.tar.gz
Nix-8eded9ecb6220bb26599419a4aaea1743d3d187e.tar.zst
Nix-8eded9ecb6220bb26599419a4aaea1743d3d187e.zip
Move cache clearing of php applications to preStart systemd
Diffstat (limited to 'nixops/modules/websites/phpfpm/default.nix')
-rw-r--r--nixops/modules/websites/phpfpm/default.nix16
1 files changed, 15 insertions, 1 deletions
diff --git a/nixops/modules/websites/phpfpm/default.nix b/nixops/modules/websites/phpfpm/default.nix
index 9c068bf..60959e0 100644
--- a/nixops/modules/websites/phpfpm/default.nix
+++ b/nixops/modules/websites/phpfpm/default.nix
@@ -95,6 +95,20 @@ in {
95 ''; 95 '';
96 }; 96 };
97 97
98 preStart = mkOption {
99 default = {};
100 type = types.attrsOf types.lines;
101 example = literalExample ''
102 { mypool = '''
103 touch foo
104 ''';
105 }
106 '';
107 description = ''
108 Extra lines that will go into the preStart systemd service
109 '';
110 };
111
98 poolPhpConfigs = mkOption { 112 poolPhpConfigs = mkOption {
99 default = {}; 113 default = {};
100 type = types.attrsOf types.lines; 114 type = types.attrsOf types.lines;
@@ -181,7 +195,7 @@ in {
181 partOf = [ "phpfpm.target" ]; 195 partOf = [ "phpfpm.target" ];
182 preStart = '' 196 preStart = ''
183 mkdir -p ${stateDir} 197 mkdir -p ${stateDir}
184 ''; 198 '' + (cfg.preStart.${pool} or "");
185 serviceConfig = let 199 serviceConfig = let
186 cfgFile = fpmCfgFile pool poolConfig; 200 cfgFile = fpmCfgFile pool poolConfig;
187 poolPhpIni = cfg.poolPhpConfigs.${pool} or ""; 201 poolPhpIni = cfg.poolPhpConfigs.${pool} or "";