haskell.nix icon indicating copy to clipboard operation
haskell.nix copied to clipboard

Modules for evaluation?

Open L-as opened this issue 3 years ago • 4 comments

Currently, modules in cabalProject' and such only apply to the post-plan building AFAICT. It seems useful to be able to define a module that will affect the arguments to cabalProject', à la the existing fake module. The use case would be changes that affect the generation of the plan, e.g. adding dependencies that aren't on Hackage.

L-as avatar May 16 '22 11:05 L-as

I am having trouble understanding what this would be for. Perhaps add an example project (does not have to work) demonstrating a use case?

hamishmack avatar May 17 '22 09:05 hamishmack

Sorry for the late answer! One use case would be exporting a haskell.nix module in one flake, that you then expect downstream users to include in their call to cabalProject' through the modules field. In our case we have a specific cabalProjectLocal that you have to use to solve issues with various packages that only support old versions of base and such.

L-as avatar May 30 '22 14:05 L-as

In our case we have a specific cabalProjectLocal that you have to use to solve issues with various packages that only support old versions of base and such.

Why wouldn't you just put those things in the projects' cabal.project files? As usual, we really prefer configuring things via cabal, rather than via nix, if at all possible.

michaelpj avatar May 30 '22 14:05 michaelpj

We could do that, but that would mean downstream has to manually keep it in sync with upstream, as is often the unfortunate case with Plutus.

L-as avatar May 30 '22 15:05 L-as

I didn't realise the input to cabalProject' was also a module when making this issue.

L-as avatar Sep 06 '22 22:09 L-as