treewide: more github runners + naive concurrency

This commit is contained in:
Nikodem Rabuliński 2024-02-10 23:36:06 +01:00
parent 2954a3f535
commit d36e9ba0f9
18 changed files with 101 additions and 63 deletions

View file

@ -17,19 +17,28 @@
};
linuxConfig = lib.optionalAttrs isLinux {
services.github-runners =
lib.mapAttrs (name: cfg: {
enable = true;
tokenFile = config.age.secrets.github-token.path;
inherit (cfg) name url;
ephemeral = true;
user = github-runner-user;
serviceOverrides = {
DynamicUser = false;
};
extraLabels = ["nix"];
})
cfg.runners;
services.github-runners = lib.pipe cfg.runners [
(lib.mapAttrsToList (
name: cfg:
lib.genList (i:
lib.nameValuePair
"${name}-${toString i}"
{
enable = true;
tokenFile = config.age.secrets.github-token.path;
inherit (cfg) url;
name = "${cfg.name}-${toString i}";
user = github-runner-user;
serviceOverrides = {
DynamicUser = false;
};
extraLabels = ["nix"];
})
cfg.instances
))
lib.flatten
lib.listToAttrs
];
users = {
users.${github-runner-user} = {
@ -59,6 +68,10 @@ in {
url = mkOption {
type = types.str;
};
instances = mkOption {
type = types.int;
default = 1;
};
};
}));
};