Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document CABAL_CONFIG env variable. #5322

Closed
gbaz opened this issue May 14, 2018 · 3 comments
Closed

document CABAL_CONFIG env variable. #5322

gbaz opened this issue May 14, 2018 · 3 comments

Comments

@gbaz
Copy link
Collaborator

gbaz commented May 14, 2018

nix-shell works by setting a bunch of env variables. It would be nice if among those variables it could set would be one that directed cabal to use a config file other than in ~/.cabal/config. That way, we could tweak all of cabal's other settings at once to make it play nicely in the nix environment. This is potentially useful in other settings as well when some other tool wants to put cabal into a specific environment.

@grayjay
Copy link
Collaborator

grayjay commented May 14, 2018

CABAL_CONFIG overrides the config file location, though it looks like it's not documented:

-- | Returns the config file path, without checking that the file exists.
-- The order of precedence is: input flag, CABAL_CONFIG, default location.
getConfigFilePath :: Flag FilePath -> IO FilePath

@hvr
Copy link
Member

hvr commented May 14, 2018

r elatedly, it may be useful to have such an env-var for setting the --project-file value via env as well

@gbaz
Copy link
Collaborator Author

gbaz commented May 14, 2018

Great! cc @ElvishJerricco. Will leave this ticket open to record documenting it

@gbaz gbaz changed the title Allow config file to be set by an env variable document CABAL_CONFIG env variable. May 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants