about summary refs log tree commit diff
path: root/modules/services/buildkite
diff options
context:
space:
mode:
Diffstat (limited to 'modules/services/buildkite')
-rw-r--r--modules/services/buildkite/default.nix61
1 files changed, 33 insertions, 28 deletions
diff --git a/modules/services/buildkite/default.nix b/modules/services/buildkite/default.nix
index 72d5e08..45c7e4f 100644
--- a/modules/services/buildkite/default.nix
+++ b/modules/services/buildkite/default.nix
@@ -14,7 +14,8 @@ let
     ln -s ${my-gerrit-hook "post-command"} $out/bin/post-command
   '';
 
-in {
+in
+{
   options.my.services.buildkite = with lib; {
     enable = mkEnableOption "buildkite agent";
   };
@@ -22,37 +23,41 @@ in {
   config = lib.mkIf cfg.enable {
     # see https://buildkite.com/docs/agent/v3
     # and https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/continuous-integration/buildkite-agents.nix
-    services.buildkite-agents = lib.listToAttrs (map (n: rec {
-      name = "builder-${toString n}";
-      value = {
-        inherit name;
-        enable = true;
-        tokenPath = secrets."buildkite/agent".path;
-        hooks.post-command = "${buildkiteHooks}/bin/post-command";
-        runtimePackages = with pkgs; [
-          bash
-          coreutils
-          curl
-          git
-          gnutar
-          gzip
-          jq
-          nix
-        ];
-      };
-    }) agents);
+    services.buildkite-agents = lib.listToAttrs (map
+      (n: rec {
+        name = "builder-${toString n}";
+        value = {
+          inherit name;
+          enable = true;
+          tokenPath = secrets."buildkite/agent".path;
+          hooks.post-command = "${buildkiteHooks}/bin/post-command";
+          runtimePackages = with pkgs; [
+            bash
+            coreutils
+            curl
+            git
+            gnutar
+            gzip
+            jq
+            nix
+          ];
+        };
+      })
+      agents);
 
     # Set up a group for all Buildkite agent users
     users = {
       groups.buildkite-agents = { };
-      users = builtins.listToAttrs (map (n: rec {
-        name = "buildkite-agent-builder-${toString n}";
-        value = {
-          isSystemUser = true;
-          group = lib.mkForce "buildkite-agents";
-          extraGroups = [ name "docker" ];
-        };
-      }) agents);
+      users = builtins.listToAttrs (map
+        (n: rec {
+          name = "buildkite-agent-builder-${toString n}";
+          value = {
+            isSystemUser = true;
+            group = lib.mkForce "buildkite-agents";
+            extraGroups = [ name "docker" ];
+          };
+        })
+        agents);
     };
   };
 }