-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
Description
Describe the bug
trusted-substituters matching appears to use raw string equality for untrusted users, so adding store query params (for example ?priority=10) causes a substituter to be rejected as untrusted even when the base URL is in trusted-substituters.
Steps To Reproduce
# /etc/nixos/configuration.nix
{
nix.settings = {
substituters = [ "https://cache.nixos.org/" ];
# explicitly allow numtide cache base URL for untrusted users
trusted-substituters = [ "https://cache.numtide.com" ];
trusted-public-keys =[ "niks3.numtide.com-1:DTx8wZduET09hRmMtKdQDxNNthLQETkc/yaX7M4qK0g=" ];
trusted-users = lib.mkForce [ "root" ];
allowed-users = [ "*" ];
};
}# flake.nix
{
nixConfig = {
extra-substituters = [ "https://cache.numtide.com?priority=10" ];
extra-trusted-public-keys = [ "niks3.numtide.com-1:DTx8wZduET09hRmMtKdQDxNNthLQETkc/yaX7M4qK0g=" ];
};
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }: {
packages.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.hello;
};
}Run:
nix build .#default --accept-flake-config -L
# ...
# ignoring untrusted substituter 'https://cache.numtide.com?priority=10', you are not a trusted user
# ...Expected behavior
Matching should treat https://hostname/path and https://hostname/path?priority=... (and potentially other store options) as the same identity for trusted-substituters.
Metadata
nix-env --version
# nix-env (Nix) 2.31.3Additional context
Ran into this attempting to use numtide/llm-agents.nix in my own nixos/nix-darwin config.
Sidenote PR #15369 would have VASTLY improved the debugging experience, hope it lands soon!
Checklist
- checked latest Nix manual (source)
- checked open bug issues and pull requests for possible duplicates
Reactions are currently unavailable