Haskell/Cabal question on bounds and versions

Hi. I’m starting to use nix with Haskell and there are a few things that really confuse me.
I installed cabal-install (v 3.0) and cabal2nix (v 2.15.0 or latest).
I had errors with a single package in my derivation, bloodhound-
The way I deal with this when not building with nix is that I have to allow newer like so
–allow-newer=containers. This allows cabal to fetch containers >= && < 0.6 and the build succeeds.
Is my understanding correct that this makes no sense in nix? because nix simply knows about one current package of containers? I was trying to overwrite the configureFlags but it did not work.

Also cabal configure uses Cabal I’m guessing this is the default used by the ghc-8.5 configuration. Is there a way to build with Cabal how would I do that?

This only relates to the first question.

First off I should warn you that I’m not near to call myself anything but a stumbling beginner.

I believe you are correct. Your build will see exactly one version of containers so if you need another version than the one included you’ll have to provide it yourself. One way of doing this is to use a configuration when pulling in nixpkgs to override some Haskell packages. You can see an example of that here.

I’m sure there are multiple other ways to achieve it.

1 Like

I see thank you @magthe. Helps a lot to see this example