2024-05-07 18:31:54 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
2024-05-14 18:48:36 +00:00
|
|
|
numRunners = 1;
|
2024-05-07 18:31:54 +00:00
|
|
|
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:46:22 +00:00
|
|
|
inherit name;
|
2024-05-07 18:31:54 +00:00
|
|
|
url = config.services.forgejo.settings.server.ROOT_URL;
|
|
|
|
tokenFile = config.age.secrets.kitchen-runner-token.path;
|
2024-06-11 17:48:50 +00:00
|
|
|
labels = ["docker-aarch64" "ubuntu-latest-aarch64:docker://ghcr.io/catthehacker/ubuntu:act-latest"];
|
2024-05-12 15:55:59 +00:00
|
|
|
settings = {
|
|
|
|
log.level = "warn";
|
|
|
|
container.network = "host";
|
|
|
|
};
|
2024-05-07 18:31:54 +00:00
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2024-05-13 12:14:21 +00:00
|
|
|
systemd.services = lib.genAttrs (builtins.genList (n: "gitea-runner-runner${builtins.toString n}") numRunners) (_: {
|
|
|
|
serviceConfig.Nice = 15;
|
|
|
|
});
|
|
|
|
|
2024-05-11 15:59:24 +00:00
|
|
|
virtualisation.podman = {
|
|
|
|
enable = true;
|
|
|
|
autoPrune.enable = true;
|
|
|
|
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
|
|
|
}
|