Skip to content

Nix

Nix CI on GitHub Actions

Every Nix build starts with an empty store and rebuilds the world.

26m → 5m
Cold build
26m → 40s
Warm build

Every Nix build starts with an empty store and rebuilds the world.

Why it happens

/nix/store is not persisted and no binary cache is configured beyond the default.

What to change

  1. Use a binary cache such as Cachix so derivations are fetched, not rebuilt
  2. Cache /nix/store between runs where the runner permits it
  3. Pin nixpkgs with a flake lock so the cache actually hits

Nix on runnerhut

yaml
jobs:
build:
runs-on: runnerhut-8vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
- uses: cachix/cachix-action@v15
with: { name: acme }
- run: nix build
A working starting point

The only runnerhut-specific line is `runs-on: runnerhut-8vcpu-ubuntu-2404`. Everything else is standard GitHub Actions — the same actions, the same secrets and the same permissions model you use today.

Your next build could be twice as fast, at half the price

Start free. Migrating away is the same one line, and we publish that diff too.