diff options
Diffstat (limited to 'nixops/modules/websites/phpfpm')
-rw-r--r-- | nixops/modules/websites/phpfpm/default.nix | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/nixops/modules/websites/phpfpm/default.nix b/nixops/modules/websites/phpfpm/default.nix index 3c6f027..882babc 100644 --- a/nixops/modules/websites/phpfpm/default.nix +++ b/nixops/modules/websites/phpfpm/default.nix | |||
@@ -72,6 +72,17 @@ in { | |||
72 | "Options appended to the PHP configuration file <filename>php.ini</filename>."; | 72 | "Options appended to the PHP configuration file <filename>php.ini</filename>."; |
73 | }; | 73 | }; |
74 | 74 | ||
75 | serviceDependencies = mkOption { | ||
76 | default = {}; | ||
77 | type = types.attrsOf (types.listOf types.string); | ||
78 | example = literalExample '' | ||
79 | { mypool = ["postgresql.service"]; } | ||
80 | ''; | ||
81 | description = '' | ||
82 | Extra service dependencies specific to pool. | ||
83 | ''; | ||
84 | }; | ||
85 | |||
75 | poolPhpConfigs = mkOption { | 86 | poolPhpConfigs = mkOption { |
76 | default = {}; | 87 | default = {}; |
77 | type = types.attrsOf types.lines; | 88 | type = types.attrsOf types.lines; |
@@ -152,7 +163,8 @@ in { | |||
152 | systemd.services = flip mapAttrs' poolConfigs (pool: poolConfig: | 163 | systemd.services = flip mapAttrs' poolConfigs (pool: poolConfig: |
153 | nameValuePair "phpfpm-${pool}" { | 164 | nameValuePair "phpfpm-${pool}" { |
154 | description = "PHP FastCGI Process Manager service for pool ${pool}"; | 165 | description = "PHP FastCGI Process Manager service for pool ${pool}"; |
155 | after = [ "network.target" ]; | 166 | after = [ "network.target" ] ++ (cfg.serviceDependencies.${pool} or []); |
167 | wants = cfg.serviceDependencies.${pool} or []; | ||
156 | wantedBy = [ "phpfpm.target" ]; | 168 | wantedBy = [ "phpfpm.target" ]; |
157 | partOf = [ "phpfpm.target" ]; | 169 | partOf = [ "phpfpm.target" ]; |
158 | preStart = '' | 170 | preStart = '' |