Show HN: The Great GitHub Nix Disk Space Heist
I created this GitHub Action to solve a persistent problem: building complex NixOS configurations in GitHub CI fails with "no space left on device" errors. Standard GitHub runners have ~20GB of free space, but sophisticated NixOS workstation or server configurations can consume 10-15GB, leaving little headroom.
Nothing but Nix uses a two-stage approach:
1. It creates a large BTRFS volume from unused space on `/mnt` (giving ~65GB immediately)
2. It starts a background process that reclaims space by removing unnecessary pre-installed software, growing the volume to ~130GB
The technical implementation uses loop devices with sparse files and carefully tuned BTRFS mount options (no discard is critical to prevent misreported allocation sizes). The purge process is powered by rmz (from the Fast Unix Commands project), which is significantly faster than standard rm.
This solution has allowed me to build my entire fleet of NixOS configurations (servers, workstations, laptops, and VMs) in CI without paying for larger runners. All builds are cached for fast deployments.
Implementation details: <https://wimpysworld.com/posts/nothing-but-nix-github-actions...>
Try it out: <https://github.com/wimpysworld/nothing-but-nix>
No comments yet