Docker + nix + gitlab ci: cache /nix/store per-machine

We also use Cachix on Gitlab, though we use a framework to avoid the boilerplate

The side benefit of cachix is that when you build locally it’ll also use the cache, and when you build locally you are also populating the cache for the CI. So win-win

The infrastructure is simply deployed with terraform:

The arch is this:

It runs thousand of pipelines a day where each pipeline has 100+ jobs. The arch auto-scales automatically, making it pretty fast and cost-effective

5 Likes