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
documentation: mention substituter precedence #3685
Conversation
That's actually not true. Binary caches have a priority field that determines the order (see the |
@edolstra what happens if two caches have the same priority? |
Then they're tried in the order in which they're defined in nix.conf. |
@edolstra thanks! I'm curious about why caches are allowed to define their own priority? I have a few cachix substituters defined and would like to be able to tell nix to prefer binaries from |
@edolstra Would this be better?
Doesn't really explain what this |
btw it isnt a good idea to depend on priority as a security feature, since it doesn't provide meaningful control over what you get from what cache. |
The original use case was to ensure that BTW I think you can also set the priority in the substituter URL (e.g. |
@grahamc Could you elaborate a bit? I'm not sure I follow. |
I marked this as stale due to inactivity. → More info |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
Is higher Priority better? The source says otherwise https://github.com/NixOS/nix/blob/master/src/libstore/store-api.hh#L195 but common usage and also experimental findings like in https://discourse.nixos.org/t/how-does-nix-choose-a-substituter-when-there-is-more-than-one-choice/3658 suggest otherwise. |
@asymmetric I set priority 50 in my s3 cache amd it gets picked over priority 40 official nixos cache. In linked issue, nix-serve with priority 30 gets checked only after the official priority 40 cache. |
@Fuuzetsu in the linked issue, priority 30 gets checked before 40:
|
Oh, you're right. I have a priority to change. Thank you for the doc update. |
Mentions the order in which substituters are queried.