From 17f6eae9907a122d4472da727ae8b1ac1c40c027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Sat, 1 Jun 2019 00:01:46 +0200 Subject: Add a filesWatcher service to restart them when secrets change --- modules/websites/default.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'modules/websites/default.nix') diff --git a/modules/websites/default.nix b/modules/websites/default.nix index e57f505..4b21efb 100644 --- a/modules/websites/default.nix +++ b/modules/websites/default.nix @@ -91,6 +91,13 @@ in }; }); }; + watchPaths = mkOption { + type = listOf string; + default = []; + description = '' + Paths to watch that should trigger a reload of httpd + ''; + }; }; }); }; @@ -159,6 +166,13 @@ in }) ) cfg; + config.services.filesWatcher = attrsets.mapAttrs' (name: icfg: attrsets.nameValuePair + "httpd${icfg.httpdName}" { + paths = icfg.watchPaths; + waitTime = 5; + } + ) cfg; + config.security.acme.certs = let typesToManage = attrsets.filterAttrs (k: v: v.enable) cfg; flatVhosts = lists.flatten (attrsets.mapAttrsToList (k: v: -- cgit v1.2.3