]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - nixops/modules/websites/phpfpm/default.nix
Move cache clearing of php applications to preStart systemd
[perso/Immae/Config/Nix.git] / nixops / modules / websites / phpfpm / default.nix
index 9c068bf604080420f059ce07ba95960304d981cb..60959e08e9812f0c4a228125146f08cdb14ccaaa 100644 (file)
@@ -95,6 +95,20 @@ in {
         '';
       };
 
+      preStart = mkOption {
+        default = {};
+        type = types.attrsOf types.lines;
+        example = literalExample ''
+          { mypool = '''
+              touch foo
+            ''';
+          }
+        '';
+        description = ''
+          Extra lines that will go into the preStart systemd service
+        '';
+      };
+
       poolPhpConfigs = mkOption {
         default = {};
         type = types.attrsOf types.lines;
@@ -181,7 +195,7 @@ in {
         partOf = [ "phpfpm.target" ];
         preStart = ''
           mkdir -p ${stateDir}
-        '';
+        '' + (cfg.preStart.${pool} or "");
         serviceConfig = let
           cfgFile = fpmCfgFile pool poolConfig;
           poolPhpIni = cfg.poolPhpConfigs.${pool} or "";