Hacker News new | ask | show | jobs
by carlmr 1311 days ago
One thing is perfect caching. Each package is cached in its own folder, so if you exchange one package you don't have to rebuild the rest of the image.

Also you can have multiple versions of the package cached.

Also all your environments benefit from the cache, since each "layer" is independent.

Docker's layer based caching is very limiting for larger images. With Nix you spend basically no time on incremental builds outside of the time for the one package you changed.

1 comments

You can also not only cache locally but cache nix builds online with services like Cachix. Then you can build a nix env on a powerful dev machine and push to the cache so when the Nix environment is built on a low powered CI machine it can easily download the build instead of trying to build and possibly time out.

Build once on one machine and all developers can just download the build.