How to specify the order of items in `nix.settings.substituters`?

Hi, I add some extra mirrors for binary cache, but nix show-config always shows substituters = .... which implies is always the first one.

I want to make “” the last one in nix.settings.substituters, how can I do that?

If you control the binary caches, you can configure their Priority.

You can use mkOrder, mkFirst and mkLast to control ordering in a merged list.

(I could misremember correct naming)

1 Like

As of nix 2.4:

  • The priority of substituters can now be overridden using the priority substituter setting (e.g. --substituters ' daemon?priority=10' ).


Thanks to @NobbZ , My final solution is:

nix.settings.substituters = lib.mkBefore [ "" ]