typeable / nixpkgs-stackage

Stackage overlay for Nixpkgs
25 stars 13 forks source link

Remove <nixpkgs> impurities #5

Open dhess opened 6 years ago

dhess commented 6 years ago

This overlay is amazing! Thank you for doing this. I'm already using it for one of my Haskell projects and I'm planning to integrate it into all of them soon.

It would be even better if you removed all of the <nixpkgs/pkgs/...> path impurities, so that you could pin the nixpkgs used throughout the project. It appears that you only use this for importing functions that nixpkgs doesn't export via pkgs, but it should still make debugging issues much easier since you would know, based on the nixpkgs-stackage revision you're using, which nixpkgs is being used for functions, as well.

I implement this technique in all of my overlays with great success. For example, here is where I create the "fetch nixpkgs" function for one of my overlays:

https://github.com/quixoftic/nixpkgs-quixoftic/blob/a6dae43adb95ca397a0de3bbb7b4602098d13a5f/lib.nix#L5

and here is an example of where I use it in the same overlay to use some unexported nixpkgs functionality:

https://github.com/quixoftic/nixpkgs-quixoftic/blob/6d73f854ca90b46d28d118848a06c03307dd2eb8/pkgs/kernels/linux-beagleboard.nix#L6

4e6 commented 6 years ago

Nice to hear it, thanks!

From the top of my head, I can recall only one nasty place where nixpkgs are referenced directly. It is <nixpkgs/pkgs/development/haskell-modules> in default.nix generated by stackage2nix. Now there is makePackageSet available in the haskell.lib, so we could try to use it instead.

4e6 commented 6 years ago

I opened the https://github.com/typeable/stackage2nix/issues/47 issue