I’m happily self-hosting Forgejo (~ Gitea) and a working local runner on a NixOS server. I only can’t get caching to work (to avoid spamming cache.nixos.org with requests). I’m currently trying to get (Github) actions caching to work like this
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- run: echo All good!
# v5 only works with newer runner tool act, when Forgejo updates to it
- uses: actions/checkout@v4
- name: Install Nix
- uses: cachix/install-nix-action@v31
- name: Nix cache
uses: actions/cache@v3
with:
path: /nix/store
key: nix-cache
# - uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix build .
In the job cache steps i always get an error:
::warning::Failed to save: reserveCache failed: connect ETIMEDOUT 10.0.0.3:34783
::warning::Cache save failed.
I’m not sure if i have to host a separate “Caching server” or just fix some runner settings. My settings are:
services.gitea-actions-runner = {
package = pkgs.forgejo-actions-runner;
instances.default = {
enable = true;
....
labels = [
# Built similar to Github images but for ACT (forgejo's runner tool)
# and can install Nix and evaluate. Recommended by ACT:
# https://github.com/catthehacker/docker_images
"ubuntu-latest:docker://ghcr.io/catthehacker/ubuntu:act-24.04"
];
# https://gitea.com/gitea/act_runner/src/branch/main/internal/pkg/config/config.example.yaml#L50
settings = {
cache.host = "localhost";
# github actions seem to want to use this port, but doesn't fix it.
cache.port = 34783;
};
};
};
How do you self-host runners with cache? Is the Github actions approach actually the best way, or should i rather host a Nix cache server like Attic.rs? If so, do you have examples?