How do I set Stackage as the system default?

The installation instructions on the Stackage website describe how to use it for a single project.

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

+3


source to share


1 answer


AFAIK cabal doesn't support a global config file. But even that won't help on its own, because afaict, you still can't turn off the configured one remote-repo

.

So, I see two approaches with obvious drawbacks.

The clean way for new users

Install the file /etc/skel/.cabal/config

to be copied to the new user accounts. However, this will not help older users.



A hacky way for all users

Set a global alias (or shell script wrapper) named cabal

which calls cabal --remote-repo=hackage.haskell.org:http://www.stackage.org/lts

.

Users can opt out of unalias

ing cabal or use a real cabal executable when using a shell script.

Users will be totally confused because cabal will tell users that he is using hackers when in fact he is using stackage.

+1


source







All Articles