mirror of
https://github.com/NixOS/nix
synced 2025-06-25 06:31:14 +02:00
Use envvars NIX_CACHE_HOME, NIX_CONFIG_HOME, NIX_DATA_HOME, NIX_STATE_HOME if defined (#11351)
This commit is contained in:
parent
c60e1be62c
commit
38bfbb297c
17 changed files with 118 additions and 48 deletions
|
@ -138,6 +138,19 @@ The following environment variables are used to determine locations of various s
|
|||
- [`XDG_STATE_HOME`]{#env-XDG_STATE_HOME} (default `~/.local/state`)
|
||||
- [`XDG_CACHE_HOME`]{#env-XDG_CACHE_HOME} (default `~/.cache`)
|
||||
|
||||
|
||||
[XDG Base Directory Specification]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||
[`use-xdg-base-directories`]: @docroot@/command-ref/conf-file.md#conf-use-xdg-base-directories
|
||||
|
||||
In addition, setting the following environment variables overrides the XDG base directories:
|
||||
|
||||
- [`NIX_CONFIG_HOME`]{#env-NIX_CONFIG_HOME} (default `$XDG_CONFIG_HOME/nix`)
|
||||
- [`NIX_STATE_HOME`]{#env-NIX_STATE_HOME} (default `$XDG_STATE_HOME/nix`)
|
||||
- [`NIX_CACHE_HOME`]{#env-NIX_CACHE_HOME} (default `$XDG_CACHE_HOME/nix`)
|
||||
|
||||
When [`use-xdg-base-directories`] is enabled, the configuration directory is:
|
||||
|
||||
1. `$NIX_CONFIG_HOME`, if it is defined
|
||||
2. Otherwise, `$XDG_CONFIG_HOME/nix`, if `XDG_CONFIG_HOME` is defined
|
||||
3. Otherwise, `~/.config/nix`.
|
||||
|
||||
Likewise for the state and cache directories.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue