Skip to content

append the cache URL at the end of substituters#1518

Open
koibtw wants to merge 1 commit into
sodiboo:mainfrom
koibtw:nix-substituters
Open

append the cache URL at the end of substituters#1518
koibtw wants to merge 1 commit into
sodiboo:mainfrom
koibtw:nix-substituters

Conversation

@koibtw

@koibtw koibtw commented Dec 16, 2025

Copy link
Copy Markdown

simply declaring substituters = [ "https://niri.cachix.org" ] in nix configuration makes it append all other substituters at the end, which results in nix.conf containing:

substituters = https://niri.cachix.org https://cache.nixos.org

i consider this to be an issue because the order of substituters matters, and this forces nix to always query https://niri.cachix.org first, which may not be desired.

this pr simply uses lib.mkAfter to fix that.

simply declaring `substituters = [ "https://niri.cachix.org" ]` in nix configuration makes it append all other substituters at the end, which results in `nix.conf` containing:
```conf
substituters = https://niri.cachix.org https://cache.nixos.org
```

i consider this to be an issue because the order of substituters matters, and this forces nix to always query `https://niri.cachix.org` first, which may not be desired.

this pr simply uses `nixpkgs.lib.mkAfter` to fix that.
@Brisingr05

Copy link
Copy Markdown

Alternatively, extra-substituters could be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants