New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for queryPathFromFileHash #3099
Conversation
This is useful if you want to know what store path a nar archive was generated from. The lookup obviously only works for paths that have been downloaded from the binary cache and not for those that were build locally. With this new piece of information it is possible to serve NAR files from the local nix store as if they came from the binary cache. Re-serving files is useful in multiple situations for example in scenarios where the bandwidth to the binary cache is limited. The part of actually providing the HTTP interface and exporting the archives in the correct format are still out of scope for this change but should be straight forward.
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/suggestion-feature-use-bittorent-or-ipfs-to-download-packages/1153/33 |
It seems conceptually wrong to have
This doesn't touch However, it's not entirely clear to me why this is needed. When serving the local store, you can generate .narinfo files that contain upstream signatures (these are stored in |
Thank you for the feedback! I posted this here mainly to gather feedback on the
I agree. This was a hack that looked like it solved my problem at the time.
I accepted that as a caveat for my version. Gotta start somewhere.
Yeah, I am skipping compression entirely for now. I probably shouldn't have abused the fileHashes as I ended up doing. I was naively hoping to implement a compatible compression at some point in the future…. Will probably not go down that road any time soon as it requires pre-compressing everything that I provide a .narinfo file for.
But that would require some node to skip the verification of NAR hashes on
The problem with reading from the SQLite database is that as an unpriviledged This made adding the one missing lookup to the store protocol sound like a good I also didn't want to rely on too much internal knowledge of Nix. One could Again thank you for the feedback. I can now go back to the drawing board and |
I marked this as stale due to inactivity. → More info |
I closed this issue due to inactivity. → More info |
This is useful if you want to know what store path a nar archive was
generated from. The lookup obviously only works for paths that have been
downloaded from the binary cache and not for those that were build
locally.
With this new piece of information it is possible to serve NAR files
from the local nix store as if they came from the binary cache.
Re-serving files is useful in multiple situations for example in
scenarios where the bandwidth to the binary cache is limited. The part
of actually providing the HTTP interface and exporting the archives in
the correct format are still out of scope for this change but should be
straight forward.
In the mean time I have implemented an avahi discovery based proxy for (re-)serving content that was downloaded from the binary cache: https://github.com/andir/local-nix-cache