treewide: more github runners + naive concurrency
This commit is contained in:
parent
2954a3f535
commit
d36e9ba0f9
18 changed files with 101 additions and 63 deletions
|
@ -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;
|
||||
};
|
||||
};
|
||||
}));
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue