mach-nix icon indicating copy to clipboard operation
mach-nix copied to clipboard

Always prioritize packagesExtra

Open bjornfor opened this issue 2 years ago • 1 comments

I was surprised by the fact that since commit f101dc4c27fb2b100f6ea1e4d48c124dea17ea34, entries in packagesExtra seem to be used only for adding pnames to the global resolver, and mach-nix is then free to get the package from any provider (and can end up ignoring the package itself).

In my case, I had had a custom tensorflow package in packagesExtra, and after updating mach-nix, it decided to use tensorflow from nixpkgs intead of my custom package, because the tensorflow package in nixpkgs had a higher version number.

Possible solution(?):

  • Implement a "packagesExtra" provider, that has infinite priority? (So that packages in that list are guaranteed to be used.) Also, not mapping packagesExtra to the nixpkgs provider seems like a good thing to me -- I was quite confused about mach-nix treating packagesExtra as "nixpkgs".

bjornfor avatar Mar 23 '22 19:03 bjornfor

I worked around this new behaviour (https://github.com/DavHau/mach-nix/commit/f101dc4c27fb2b100f6ea1e4d48c124dea17ea34) by specifying a high number suffix in pname (pname = "${pname}_999") to get my local package to "win".

bjornfor avatar Mar 24 '22 11:03 bjornfor