2024-05-07 18:31:54 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
numRunners = 2;
|
|
|
|
in {
|
|
|
|
age.secrets.kitchen-runner-token = {
|
|
|
|
file = ../../secrets/kitchen-runner-token.age;
|
|
|
|
owner = "gitea-runner";
|
|
|
|
};
|
|
|
|
|
|
|
|
services.gitea-actions-runner = {
|
|
|
|
package = pkgs.forgejo-actions-runner;
|
|
|
|
|
|
|
|
instances = lib.genAttrs (builtins.genList (n: "runner${builtins.toString n}") numRunners) (name: {
|
|
|
|
enable = true;
|
2024-05-07 19:35:04 +00:00
|
|
|
name = "runner${builtins.toString n}";
|
2024-05-07 18:31:54 +00:00
|
|
|
url = config.services.forgejo.settings.server.ROOT_URL;
|
|
|
|
tokenFile = config.age.secrets.kitchen-runner-token.path;
|
|
|
|
labels = ["docker" "ubuntu-latest:docker://ghcr.io/catthehacker/ubuntu:act-latest"];
|
|
|
|
settings.log.level = "warn";
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
virtualisation.podman = {
|
|
|
|
enable = true;
|
|
|
|
autoPrune.enable = true;
|
2024-05-07 19:40:48 +00:00
|
|
|
dockerSocket.enable = true;
|
2024-05-07 18:31:54 +00:00
|
|
|
};
|
2024-05-07 18:56:54 +00:00
|
|
|
|
|
|
|
users.groups.gitea-runner = {};
|
|
|
|
users.users.gitea-runner = {
|
|
|
|
isSystemUser = true;
|
|
|
|
group = "gitea-runner";
|
2024-05-07 19:40:48 +00:00
|
|
|
extraGroups = ["podman"];
|
2024-05-07 18:56:54 +00:00
|
|
|
home = "/var/lib/gitea-runner/";
|
|
|
|
};
|
2024-05-07 18:31:54 +00:00
|
|
|
}
|