Petr
Petr

Reputation: 63399

How to install Stackage as the system default?

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?

Upvotes: 3

Views: 131

Answers (1)

ibotty
ibotty

Reputation: 739

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.

Upvotes: 1

Related Questions