Welcome to Forgejo and it's Runners
CI (Continuous Integration system)
I have been using some form of a CI either in GitHub or recently GitLab with it's CI but not with Forgejo/Gitea (they both use the same runner process since Forgejo is a hard fork of Gitea) so I thought it was time to change that!
NixOS Service
Getting it going on a NixOS install is pretty easy (without using a secret management tool like agenix):
1 { config, pkgs, lib, ... }:
2
3 let
4 cfg = config.services.forgejo;
5 srv = cfg.settings.server;
6 in
7 {
8 services.forgejo = {
9 enable = true;
10 database.type = "postgres";
11 stateDir = "/mnt/DATA/Git";
12 # Enable support for Git Large File Storage
13 lfs.enable = true;
14 settings = {
15 server = {
16 DOMAIN = "git.ahoneybun.net";
17 # You need to specify this to remove the port from URLs in the web UI.
18 ROOT_URL = "https://srv.DOMAIN/";
19 HTTP_PORT = 3001;
20 };
21 # You can temporarily allow registration to create an admin user.
22 service.DISABLE_REGISTRATION = true;
23 };
24 };
25 }
once you add that to your configuration.nix (or another nix file that you import) and rebuild you'll find it running on port 3001 (localhost:3001).
Setting up a Forgejo Runner
Since Forgejo is a fork from Gitea NixOS reuses it's gitea-actions-runner service (you should use something like agenix rather than a plaintext file like I did...):
1 { lib, pkgs, config, ... }: {
2 services.gitea-actions-runner = {
3 package = pkgs.forgejo-runner;
4 instances.default = {
5 enable = true;
6 name = "edi";
7 url = "https://git.ahoneybun.net";
8 tokenFile = "/etc/nixos/services/forgejo-runner-mono.txt";
9 labels = [
10 "ubuntu-24.04:docker://ubuntu:24.04"
11 "ubuntu-22.04:docker://ubuntu:22.04"
12 "nix-latest:docker://nixos/nix:latest"
13 "rust-latest:docker://rust:latest"
14 "amd64-builder"
15 ];
16 };
17 };
18 }
I have a few labels which are the docker images I want to use and the name of the runner itself which I'll reference soon.
Now this covers my usage of building on x86_64 but what about aarch64? Well I have my Pi 5 setup with Armbian and after going though armbian-config to install Docker I used this page to set it up as a runner!
1 aaron@sidera:~$ systemctl status forgejo-runner.service
2 ● forgejo-runner.service - Forgejo Runner
3 Loaded: loaded (/etc/systemd/system/forgejo-runner.service; enabled; preset: enabled)
4 Active: active (running) since Mon 2025-12-15 08:30:59 MST; 1 day 3h ago
5 Docs: https://forgejo.org/docs/latest/admin/actions/
6 Main PID: 91170 (forgejo-runner)
7 Tasks: 10 (limit: 4670)
8 Memory: 8.8M (peak: 10.8M)
9 CPU: 37.373s
10 CGroup: /system.slice/forgejo-runner.service
11 └─91170 /usr/local/bin/forgejo-runner daemon
12
13 Dec 15 12:17:14 sidera forgejo-runner[91170]: time="2025-12-15T12:17:14-07:00" level=info msg="task 139 repo is ahoneybun/lazarus https://data.forgejo.org https://git.ahoneybun.net"
14 Dec 15 12:17:15 sidera forgejo-runner[91170]: time="2025-12-15T12:17:15-07:00" level=info msg="Cleaning up network for job arm64, and network name is: WORKFLOW-b10a3c6697f9b9e7a59e514dd53d2fef"
15 Dec 15 12:25:22 sidera forgejo-runner[91170]: time="2025-12-15T12:25:22-07:00" level=info msg="task 142 repo is ahoneybun/lazarus https://data.forgejo.org https://git.ahoneybun.net"
16 Dec 15 12:25:23 sidera forgejo-runner[91170]: time="2025-12-15T12:25:23-07:00" level=info msg="Cleaning up network for job arm64, and network name is: WORKFLOW-4b01f1d79963a84cfb5f0ae7b7dc2c21"
17 Dec 15 12:25:52 sidera forgejo-runner[91170]: time="2025-12-15T12:25:52-07:00" level=info msg="task 144 repo is ahoneybun/lazarus https://data.forgejo.org https://git.ahoneybun.net"
18 Dec 15 12:25:53 sidera forgejo-runner[91170]: time="2025-12-15T12:25:53-07:00" level=info msg="Cleaning up network for job arm64, and network name is: WORKFLOW-1a969f4f5a4f1e8118fcbd787e2bc3e0"
19 Dec 15 12:27:20 sidera forgejo-runner[91170]: time="2025-12-15T12:27:20-07:00" level=info msg="task 146 repo is ahoneybun/lazarus https://data.forgejo.org https://git.ahoneybun.net"
20 Dec 15 12:27:21 sidera forgejo-runner[91170]: time="2025-12-15T12:27:21-07:00" level=info msg="Cleaning up network for job arm64, and network name is: WORKFLOW-7d76fbfca6a7d3c3128fa7d75c86b90b"
21 Dec 15 12:28:20 sidera forgejo-runner[91170]: time="2025-12-15T12:28:20-07:00" level=info msg="task 148 repo is ahoneybun/lazarus https://data.forgejo.org https://git.ahoneybun.net"
22 Dec 15 12:28:21 sidera forgejo-runner[91170]: time="2025-12-15T12:28:21-07:00" level=info msg="Cleaning up network for job arm64, and network name is: WORKFLOW-826c02b6fed5affadcdb107cdfd65205"
Actions
The version that is in NixOS 25.11 has Actions enabled but the docs say you need to enable it per repository for an older version. Now the interesting part is that Gitea uses GitHub Actions syntax so take this one for example:
1 name: Example
2
3 on:
4 push:
5 branches:
6
7 jobs:
8 amd64:
9 runs-on:
10 steps:
11 - name: System Info
12 run: |
13 cat /etc/os-release
14 echo
15 uname -m
here we note that it is using a Ubuntu 24.04 Docker image and it will run on the amd64 system (which is edi in this case), for the Pi 5 I'll say arm64-builder instead.
Other questions
For more reading I have my nix files hosted on GitLab here. Reach out to my on Mastodon for questions!