In a setting where your CI is pushing to your nix binary cache, have you ever noticed that build artifacts usually have to be pushed a second time? What if it wasn’t necessary? nar-serve is a HTTP service that you can put in front of your cache and serve the content of the NAR files directly.
Use cases
- Avoid publishing build artifacts to both the binary cache and another service.
- Allows to share build results easily.
- Inspect the content of a NAR file.
Demo
https://nar-serve.zimbatm.now.sh/ is a demo deployment that connects to https://cache.nixos.org/ . It’s freely available but I don’t make any guarantees in terms of availability
Append any store path to the hostname to fetch and unpack it on the fly. That’s it.
Eg:
Contact
If that’s something you would be interested in deploying in your company, please contact me.
The source code is all freely available at GitHub - numtide/nar-serve: Unpack and serve NAR file content on the fly and I am available to develop extensions for it.