How to install Stackage as the system default?

146 views Asked by At

The installation instructions at the Stackage web site describe how to use it for one project.

Is there a way how to configure Stackage to be the default for all users and install packages globally available to them?

1

There are 1 answers

0
ibotty On

AFAIK cabal does not support a global config file. But even that won't help by itself because afaict, you can't disable configured remote-repos anyway.

So I see two approaches with obvious drawbacks.

Clean way for new users

Install a /etc/skel/.cabal/config file that will be copied to new user accounts. That won't help with older users though.

Hacky way for all users

Install a global alias (or shell script wrapper) with name cabal that calls cabal --remote-repo=hackage.haskell.org:http://www.stackage.org/lts.

Users can opt out by unaliasing cabal or using the real cabal executable when using a shell script.

Users will be utterly confused though, because cabal will tell users it uses hackage, when in fact it is using stackage.