Nothing but Nix
Here’s a tool I’ve created that might help those who build complex NixOS configurations in GitHub CI.
The problem
Standard GitHub Actions runners have only ~20GB of free disk space, or so they would have you believe. If you’ve tried to build sophisticated NixOS or Home Manager configurations in CI, you might have encountered “no space left on device” error. A comprehensive workstation or server setup can consume 10-15GB, leaving precious little headroom
This space limitation meant I couldn’t build my full configurations in CI, preventing me from properly caching complete builds. Each change to my workstations and servers required frustrating additional compilation time for things like 3rd party kernel modules, Ollama, custom package overrides, and more
The solution: Nothing but Nix 

Nothing but Nix is a GitHub Action that transforms standard GitHub runners from ~20GB spaces into 65-130GB Nix powerhouses
Here’s how it works:
- Initial Volume Creation: Creates a large BTRFS volume from free space on
/mnt
- Background Purge: Ruthlessly eliminates unnecessary software to reclaim even more space, while your workflow runs
- Dynamic Growth: Expands your Nix volume as space becomes available
Technical implementation
The action uses loop devices with sparse files and a BTRFS filesystem:
# Create a large disk image in the free space
free_space=$(df -m --output=avail /mnt | tail -n 1 | tr -d ' ')
loop_dev=$(sudo losetup --find)
sudo fallocate -l $((free_space - 1024))M "/mnt/disk0.img"
sudo losetup "${loop_dev}" "/mnt/disk0.img"
# Set up an optimized BTRFS filesystem
sudo mkfs.btrfs -L nix -d raid0 -m raid0 --nodiscard "${loop_dev}"
sudo mount LABEL=nix /nix -o noatime,nobarrier,nodiscard,compress=zstd:1,space_cache=v2,commit=120
The nodiscard
mount option is essential to prevent misreported allocation sizes when using loop devices backed by sparse files.
I’ve written The Nix Space Heist: Reclaiming 130GB in GitHub Actions blog post that goes into more detail
Usage 
This action requires that it runs before Nix is installed. Add it before your Nix installation like so:
- uses: actions/checkout@v4
- uses: wimpysworld/nothing-but-nix@main
- uses: DeterminateSystems/nix-installer-action@main
- run: nix flake check
Would love to hear from others who try it out or have alternative approaches to this problem!