Description
I think, it is pretty normal to use haskell.nix on the CI, and also it is a good idea to have -Werror
on the CI, but only for local (project) packages. Stack supports this by allowing one to set options on a fake package called $local
, but, arguably, stack.yaml
is not the right place to have this, since during development you don’t actually want to have -Werror
.
In haskell.nix it feels like some combination of modules
on e.g. stackProject
and haskellLib.selectProjectPackages
could do the trick, but this is, obviously, a very bad idea and won’t work because of recursion. The problem is that we need to have the result of stackProject
to get at list of local packages, but then what we want to craft based on this output is actually one of the inputs of the function.
Prior art:
- Add support for setting ghcOptions on all packages #1046 made it possible to set
ghcOptions
on all packages at once, but that is too much. - There is a working solution in Modify package options for all local packages #298 (comment), but, arguably, it is a bit too hacky.