aboutsummaryrefslogtreecommitdiff
path: root/modules/private/buildbot/default.nix
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-06-01 00:01:46 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-06-01 00:01:46 +0200
commit17f6eae9907a122d4472da727ae8b1ac1c40c027 (patch)
tree133ab8877a47ec707cb8c96e561a29e45395fce6 /modules/private/buildbot/default.nix
parentf33aade75160a345a721fd60451b9edaa4d10e44 (diff)
downloadNix-17f6eae9907a122d4472da727ae8b1ac1c40c027.tar.gz
Nix-17f6eae9907a122d4472da727ae8b1ac1c40c027.tar.zst
Nix-17f6eae9907a122d4472da727ae8b1ac1c40c027.zip
Add a filesWatcher service to restart them when secrets change
Diffstat (limited to 'modules/private/buildbot/default.nix')
-rw-r--r--modules/private/buildbot/default.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/private/buildbot/default.nix b/modules/private/buildbot/default.nix
index fa6a6f2..d023a83 100644
--- a/modules/private/buildbot/default.nix
+++ b/modules/private/buildbot/default.nix
@@ -37,6 +37,10 @@ in
37 extraGroups = [ "keys" ]; 37 extraGroups = [ "keys" ];
38 }; 38 };
39 39
40 services.websites.tools.watchPaths = lib.attrsets.mapAttrsToList
41 (k: project: "/var/secrets/buildbot/${project.name}/webhook-httpd-include")
42 myconfig.env.buildbot.projects;
43
40 services.websites.tools.vhostConfs.git.extraConfig = lib.attrsets.mapAttrsToList (k: project: '' 44 services.websites.tools.vhostConfs.git.extraConfig = lib.attrsets.mapAttrsToList (k: project: ''
41 RedirectMatch permanent "^/buildbot/${project.name}$" "/buildbot/${project.name}/" 45 RedirectMatch permanent "^/buildbot/${project.name}$" "/buildbot/${project.name}/"
42 RewriteEngine On 46 RewriteEngine On
@@ -106,6 +110,14 @@ in
106 } 110 }
107 ]; 111 ];
108 112
113 services.filesWatcher = lib.attrsets.mapAttrs' (k: project: lib.attrsets.nameValuePair "buildbot-${project.name}" {
114 restart = true;
115 paths = [
116 "/var/secrets/buildbot/ldap"
117 "/var/secrets/buildbot/ssh_key"
118 ] ++ lib.attrsets.mapAttrsToList (k: v: "/var/secrets/buildbot/${project.name}/${k}") project.secrets;
119 }) myconfig.env.buildbot.projects;
120
109 systemd.services = lib.attrsets.mapAttrs' (k: project: lib.attrsets.nameValuePair "buildbot-${project.name}" { 121 systemd.services = lib.attrsets.mapAttrs' (k: project: lib.attrsets.nameValuePair "buildbot-${project.name}" {
110 description = "Buildbot Continuous Integration Server ${project.name}."; 122 description = "Buildbot Continuous Integration Server ${project.name}.";
111 after = [ "network-online.target" ]; 123 after = [ "network-online.target" ];