diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-06-01 00:01:46 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-04-25 00:04:23 +0200 |
commit | 06782a203fa0ed5ab29a03c96294f138209211da (patch) | |
tree | 8b51a7307e867e3b7cf9467efe0ebd93ff3e78b3 /modules/websites | |
parent | a3eb56c4fc73da93d42c9298cc94aafffca0bd37 (diff) | |
download | NUR-06782a203fa0ed5ab29a03c96294f138209211da.tar.gz NUR-06782a203fa0ed5ab29a03c96294f138209211da.tar.zst NUR-06782a203fa0ed5ab29a03c96294f138209211da.zip |
Add a filesWatcher service to restart them when secrets change
Diffstat (limited to 'modules/websites')
-rw-r--r-- | modules/websites/default.nix | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/websites/default.nix b/modules/websites/default.nix index e57f505a..4b21efb7 100644 --- a/modules/websites/default.nix +++ b/modules/websites/default.nix | |||
@@ -91,6 +91,13 @@ in | |||
91 | }; | 91 | }; |
92 | }); | 92 | }); |
93 | }; | 93 | }; |
94 | watchPaths = mkOption { | ||
95 | type = listOf string; | ||
96 | default = []; | ||
97 | description = '' | ||
98 | Paths to watch that should trigger a reload of httpd | ||
99 | ''; | ||
100 | }; | ||
94 | }; | 101 | }; |
95 | }); | 102 | }); |
96 | }; | 103 | }; |
@@ -159,6 +166,13 @@ in | |||
159 | }) | 166 | }) |
160 | ) cfg; | 167 | ) cfg; |
161 | 168 | ||
169 | config.services.filesWatcher = attrsets.mapAttrs' (name: icfg: attrsets.nameValuePair | ||
170 | "httpd${icfg.httpdName}" { | ||
171 | paths = icfg.watchPaths; | ||
172 | waitTime = 5; | ||
173 | } | ||
174 | ) cfg; | ||
175 | |||
162 | config.security.acme.certs = let | 176 | config.security.acme.certs = let |
163 | typesToManage = attrsets.filterAttrs (k: v: v.enable) cfg; | 177 | typesToManage = attrsets.filterAttrs (k: v: v.enable) cfg; |
164 | flatVhosts = lists.flatten (attrsets.mapAttrsToList (k: v: | 178 | flatVhosts = lists.flatten (attrsets.mapAttrsToList (k: v: |