Github actions CI: error: writing to file: No space left on device

This has suddenly started on my CI for my open source nixos rust project.

[...]
building '/nix/store/iq1pzsamk18d22s043r0f3xrwncwpj2b-hosts.drv'...
building '/nix/store/szhyqzs08fg4d78yn0kw9rgrsws6pcqy-dioxus-cli-0.7.1.drv'...
error: writing to file: No space left on device
Error: Process completed with exit code 1.

How do I resolve?

GitHub’s default runners are known to have a lot of limitations. You can always host your own runner or use something like namespaces. Though, I would recommend something like Garnix or Hercules CI for a proper nix friendly CI.

You can use something like GitHub - wimpysworld/nothing-but-nix: Create a 130GB Nix ️store in GitHub runners ❄️ Multi-partition BTRFS RAID-0 for /nix 💪 Brutally purges unnecessary software 🪓 Dynamically grows the Nix store 📈 to make space on the runner.

1 Like

Hmmm. Have some mixed feelings here.

Checking my understanding of some of the pros/cons:

nothing-but-nix will work with existing CI, minimal changes required.

Github CI is 26-37 minutes which is rather slow. My attempts to try to speed this up have so far been unsuccessful. Possibly my attempts at caching are not working. Presumably something like Garnix of Hercules CI would be faster?

Garnix looks like needs payment for anything other then limited trial, $25 a month. Probably USD, so more in AUD.

Hercules CI is free for open source, but requires own infrastructure for runners. Which I imagine could end up being expensive for open source developer.

At present I have a kludge from determinate-nixd to update the required hashes in nix.flake (which probably is slow because I haven’t been able to get caching to work with determinate-nixd; but similar time to the other CI jobs). Which is important for something like dependandabot or renovatebot to generate working pull requests. Suspect this will not work with Garnix or Hercules CI.

My initial attempt to use nothing-but-nix seems to have failed :frowning:

OK, think I need to use nix-permission-edict: true. If not using DeterminateSystems/nix-installer-action.

1 Like