2023-09-24 22:45:43 -06:00
|
|
|
{ pkgs, config, makeEnable, ... }:
|
2024-09-26 14:15:27 -06:00
|
|
|
makeEnable config "myModules.gitea-runner" false {
|
2023-09-24 22:45:43 -06:00
|
|
|
age.secrets.gitea-runner-token = {
|
|
|
|
file = ./secrets/gitea-runner-token.${config.networking.hostName}.age;
|
|
|
|
group = "docker";
|
|
|
|
};
|
|
|
|
|
|
|
|
services.gitea-actions-runner.instances.nix =
|
|
|
|
let gitea-runner-directory = "/var/lib/gitea-runner";
|
|
|
|
in {
|
|
|
|
settings = {
|
|
|
|
cache = {
|
|
|
|
enabled = true;
|
|
|
|
};
|
|
|
|
container = {
|
|
|
|
workdir_parent = "${gitea-runner-directory}/workspace";
|
|
|
|
};
|
|
|
|
host = {
|
|
|
|
workdir_parent = "${gitea-runner-directory}/action-cache-dir";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
hostPackages = with pkgs; [
|
|
|
|
bash
|
2024-03-11 23:53:55 -06:00
|
|
|
direnv
|
2023-09-24 22:45:43 -06:00
|
|
|
coreutils
|
|
|
|
curl
|
|
|
|
gawk
|
|
|
|
git-lfs
|
|
|
|
nixFlakes
|
|
|
|
gitFull
|
|
|
|
gnused
|
|
|
|
nodejs
|
2024-03-11 23:53:55 -06:00
|
|
|
docker
|
|
|
|
openssh
|
2023-09-24 22:45:43 -06:00
|
|
|
wget
|
|
|
|
];
|
|
|
|
enable = true;
|
|
|
|
name = config.networking.hostName;
|
2023-11-16 02:05:10 -07:00
|
|
|
url = "https://dev.railbird.ai";
|
2023-09-24 22:45:43 -06:00
|
|
|
tokenFile = config.age.secrets.gitea-runner-token.path;
|
|
|
|
labels = [
|
|
|
|
"nixos-${pkgs.system}:host"
|
|
|
|
"nix:docker://localhost:5921/nix-runner"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.services.gitea-runner-nix.environment =
|
|
|
|
let gitea-runner-directory = "/var/lib/gitea-runner"; in {
|
|
|
|
XDG_CONFIG_HOME = gitea-runner-directory;
|
|
|
|
XDG_CACHE_HOME = "${gitea-runner-directory}/.cache";
|
|
|
|
};
|
2024-03-12 00:00:10 -06:00
|
|
|
users.groups.gitea-runner = {};
|
2024-03-11 23:53:55 -06:00
|
|
|
users.users.gitea-runner = {
|
2024-03-11 23:58:51 -06:00
|
|
|
isSystemUser = true;
|
|
|
|
group = "gitea-runner";
|
2024-03-11 23:53:55 -06:00
|
|
|
extraGroups = ["docker"];
|
|
|
|
home = "/var/lib/gitea-runner";
|
|
|
|
};
|
2023-09-24 22:45:43 -06:00
|
|
|
}
|