commercialhaskell / stack

The Haskell Tool Stack
http://haskellstack.org
BSD 3-Clause "New" or "Revised" License
3.99k stars 845 forks source link

Make nix packages additive between stack.yaml and ~/.stack/config.yaml #4401

Open rybern opened 5 years ago

rybern commented 5 years ago

My understanding is that the nix packages from the local stack.yaml override the nix packages from ~/.stack/config.yaml. That means that if I need to add a project-specific nix package to stack.yaml, I also need to copy all of the nix packages from ~/.stack/config.yaml.

Is this an accurate understanding of the current behavior? If so, I would find it much more convenient if stack instead added the package lists together. Is this as easy as changing nixMonoidPackages in NixOptsMonoid from First [Text] to [Text]?

dbaynard commented 5 years ago

Hi @rybern, I can dig around in the source to check current behaviour. But usually the sort of change you suggested (First [a] to [a]) would need duplicates removing.

I suspect that stack would override the behaviour as project build behaviour should be reproducible no matter what settings there are in ~/.stack/config.yaml. In this case, it would be a design decision not to combine, as that may then mean a project configuration depends on the non–project specific ~/.stack/config.yaml. But I shall check.