Nix has a very nice callCabal2nix function that can wrap a Haskell project and provide the dependencies for it without having to change the Haskell project, which remains the source of truth.
(I'm not 100% certain the monorepo ones are correct in terms of publishing the packages. And I haven't begun to figure out things like how to control the compiler version, say if you want to avoid that one GNU library, or cross compile, or whatever.)
Problem
Nix has a very nice
callCabal2nix
function that can wrap a Haskell project and provide the dependencies for it without having to change the Haskell project, which remains the source of truth.When I figured this out, I couldn't actually find documentation for this anywhere. It doesn't even come up in https://haskell4nix.readthedocs.io/search.html?q=callCabal2Nix&check_keywords=yes&area=default
Proposal
We could do with, at the very least, some minimal examples like https://gist.github.com/ScottFreeCode/9b0ea3e52fa56c93ea8ca14791e55bb4
(I'm not 100% certain the monorepo ones are correct in terms of publishing the packages. And I haven't begun to figure out things like how to control the compiler version, say if you want to avoid that one GNU library, or cross compile, or whatever.)
Checklist