feat(whitby): Run a handful of Buildkite agents

This is the point of the machine, afterall.

Change-Id: I15c11600c1c18fa8962d57f75f99a72e1553f9c2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/853
Reviewed-by: glittershark <grfn@gws.fyi>
Reviewed-by: BuildkiteCI
Tested-by: BuildkiteCI
This commit is contained in:
Vincent Ambo 2020-07-02 20:27:02 +01:00 committed by tazjin
parent 7114e72d81
commit 4d9c6dbbe2

View file

@ -1,8 +1,18 @@
{ depot, lib, ... }:
let
inherit (builtins) listToAttrs;
inherit (lib) range;
nixpkgs = import depot.third_party.nixpkgsSrc {};
# All Buildkite hooks are actually besadii, but it's being invoked
# with different names.
buildkiteHooks = depot.third_party.runCommandNoCC "buildkite-hooks" {} ''
mkdir -p $out/bin
ln -s ${depot.ops.besadii}/bin/besadii $out/bin/post-command
'';
systemForConfig = configuration: (depot.third_party.nixos {
inherit configuration;
}).system;
@ -119,6 +129,17 @@ in systemForConfig {
programs.mtr.enable = true;
services.openssh.enable = true;
# Run a handful of Buildkite agents to support parallel builds.
services.buildkite-agents = listToAttrs (map (n: rec {
name = "whitby-${toString n}";
value = {
inherit name;
enable = true;
tokenPath = "/etc/secrets/buildkite-agent-token";
hooks.post-command = "${buildkiteHooks}/bin/post-command";
};
}) (range 1 8));
environment.systemPackages = with nixpkgs; [
bb
curl