How can I use Stackage's cabal.config files with nix-style cabal?

160 Views Asked by At

Stackage provides a cabal.config file with each snapshot, e.g. this one. How can I make cabal new-configure a project with the package versions from that file?

(Alternatively: Is there another way to configure a nix-style cabal project with dependency versions from a specific Stackage snapshot?)

1

There are 1 best solutions below

0
On

The cabal.config files from Stackage only contain a single huge constraints section with the same syntax that the cabal.project files use.

So you can simply copy these constraints into your cabal.project.local file, delete any constraints for packages in your local project and new-build.