Commit 8dea20f6 authored by Oleg Grenrus's avatar Oleg Grenrus

Resolve #6515: Add section on environment variables

parent e348e510
......@@ -41,6 +41,53 @@ executables by default, you would change this line to
You can also use ``cabal user-config update`` to migrate configuration
files created by older versions of ``cabal``.
Environment variables
Various environment variables affect ``cabal-install``.
The variable to find global configuration file.
Default content directory for ``cabal-install`` files.
Default value is ``getAppUserDataDirectory "cabal"``, which is
``$HOME/.cabal`` on unix systems.
.. note::
The CABAL_DIR might be dropped in the future, when
``cabal-install`` starts to use XDG Directory specification.
The override for default ``dist`` build directory.
Note, the nix-style builds build directory (``dist-newstyle``)
is not affected by this environment variable.
Variable related to deprecated sandbox functionality.
Variable related to deprecated sandbox functionality.
Configuration file discovery
1. If ``$CABAL_CONFIG`` is set use it,
2. otherwise if ``$CABAL_DIR`` is set use ``$CABAL_DIR/config``
3. otherwise use ``getAppUserDirectory "cabal"``
If the configuration file doesn't exist ``cabal-install``
will generate the default one, with directories based on
``$CABAL_DIR`` (if set) or ``getAppUserDirectory "cabal"`` prefix.
.. note:
If ``$CABAL_CONFIG`` is set, but the file doesn't exist,
one will be generated with ``$CABAL_DIR`` or ``getAppUserDirectory "cabal"``
based prefixes. In other words not the prefixes based on a
directory part of ``$CABAL_CONFIG`` path.
Repository specification
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment