Files
nix/modules/services/gitea-runner.nix
T
2026-10-21 04:52:51 -05:00

20 lines
1021 B
Nix

{
# Gitea Actions runner on box itself; jobs run directly on the host (label "native").
den.aspects.services.gitea-runner.nixos = { config, host, pkgs, ... }: let
home = config.users.users.${host.owner}.home;
in {
# Owner's GitHub SSH key, readable by jobs at $CREDENTIALS_DIRECTORY/github; never in Gitea.
systemd.services."gitea-runner-${config.networking.hostName}".serviceConfig.LoadCredential = [ "github:${home}/.ssh/id_rsa" ];
services.gitea-actions-runner.instances.${config.networking.hostName} = {
enable = true;
name = config.networking.hostName;
url = "http://127.0.0.1:${toString config.services.gitea.settings.server.HTTP_PORT}";
# TOKEN=<registration token from `gitea actions generate-runner-token`>
tokenFile = "${config.users.users.${host.owner}.home}/.config/gitea-runner/token";
labels = [ "native:host" ];
hostPackages = with pkgs; [ bash coreutils gnused gnugrep findutils git openssh curl jq nix nodejs attic-client ];
};
};
}