Skip to content

Gitea Actions Runner

Gitea Actions Runner NixOS module running the Forgejo runner package for Forgejo instances with pre-configured runners.

View the synix NixOS module on Forgejo.

References

Setup

Generate a registration token for your runner (here: nix) and store it in sops:

gitea-actions-runner:
    nix:
        token: abc123

Config

This module provides pre-configured runner instances:

  • nix (label: ${config.networking.hostName}-nix:host): Shell runner with access to the host's nix store.
{ config, inputs, ... }:

{
  imports = [ inputs.synix.nixosModules.gitea-actions-runner ];

  services.gitea-actions-runner.instances = {
    nix = {
      enable = true;
      url = "https://git.example.com/foo/bar";
      tokenFile = config.sops.templates."gitea-actions-runner/nix/token".path;
    };
  };

  sops = {
    secrets."gitea-actions-runner/nix/token" = { };
    templates."gitea-actions-runner/nix/token".content = ''
      TOKEN=${config.sops.placeholder."gitea-actions-runner/nix/token"}
    '';
  };
}