Ever since I built my first NixOS system (I started by building a custom image to upload on DigitalOcean), I’ve been bothered by one thing: the default installation size is large. To give you an idea, this simple system (using flakes):
When I started working on improving this, I expected the eventual blog post to be very different than what it became, but you can’t win everything in life. There’s a bit of pain ahead.
I really like Nix and NixOS (I wouldn’t be spending time helping with their documentation otherwise). After spending some time managing NixOS servers, I really can’t see myself going back to other systems unless required by some external factor. I’m also working on a system that has worker machines which will spin up a bunch of microVMs.
Naturally, I wanted to use NixOS both for the worker machines and the microVMs themselves. Currently, the system on the microVMs is taking ~210MB (including kernel) of disk space, but it’s based on Alpine. The worker machines are already using NixOS, but I’d like them to be as lean as possible.