diff options
author | zimbatm <zimbatm@zimbatm.com> | 2020-03-30 15:31:14 +0200 |
---|---|---|
committer | zimbatm <zimbatm@zimbatm.com> | 2020-04-14 18:45:06 +0200 |
commit | 895516cadf0739dd8359a38d503e0aaf5068dc4b (patch) | |
tree | 7ba6876161f27c1dae6cca0922a8b9c0d6b11144 /doc/manual/command-ref | |
parent | 3abf6d03c611417b309fdedf4323c08e6afbcd9c (diff) |
add NIX_USER_CONF_FILES
Motivation: maintain project-level configuration files.
Document the whole situation a bit better so that it corresponds to the
implementation, and add NIX_USER_CONF_FILES that allows overriding
which user files Nix will load during startup.
Diffstat (limited to 'doc/manual/command-ref')
-rw-r--r-- | doc/manual/command-ref/conf-file.xml | 36 | ||||
-rw-r--r-- | doc/manual/command-ref/env-common.xml | 13 |
2 files changed, 30 insertions, 19 deletions
diff --git a/doc/manual/command-ref/conf-file.xml b/doc/manual/command-ref/conf-file.xml index 48dce7c95..1820598e5 100644 --- a/doc/manual/command-ref/conf-file.xml +++ b/doc/manual/command-ref/conf-file.xml @@ -19,26 +19,30 @@ <refsection><title>Description</title> -<para>Nix reads settings from two configuration files:</para> +<para>By default Nix reads settings from the following places:</para> + +<para>The system-wide configuration file +<filename><replaceable>sysconfdir</replaceable>/nix/nix.conf</filename> +(i.e. <filename>/etc/nix/nix.conf</filename> on most systems), or +<filename>$NIX_CONF_DIR/nix.conf</filename> if +<envar>NIX_CONF_DIR</envar> is set. Values loaded in this file are not forwarded to the Nix daemon. The +client assumes that the daemon has already loaded them. +</para> -<itemizedlist> +<para>User-specific configuration files:</para> - <listitem> - <para>The system-wide configuration file - <filename><replaceable>sysconfdir</replaceable>/nix/nix.conf</filename> - (i.e. <filename>/etc/nix/nix.conf</filename> on most systems), or - <filename>$NIX_CONF_DIR/nix.conf</filename> if - <envar>NIX_CONF_DIR</envar> is set.</para> - </listitem> +<para> + If <envar>NIX_USER_CONF_FILES</envar> is set, then each path separated by + <literal>:</literal> will be loaded in reverse order. +</para> - <listitem> - <para>The user configuration file - <filename>$XDG_CONFIG_HOME/nix/nix.conf</filename>, or - <filename>~/.config/nix/nix.conf</filename> if - <envar>XDG_CONFIG_HOME</envar> is not set.</para> - </listitem> +<para> + Otherwise it will look for <filename>nix/nix.conf</filename> files in + <envar>XDG_CONFIG_DIRS</envar> and <envar>XDG_CONFIG_HOME</envar>. -</itemizedlist> + The default location is <filename>$HOME/.config/nix.conf</filename> if + those environment variables are unset. +</para> <para>The configuration files consist of <literal><replaceable>name</replaceable> = diff --git a/doc/manual/command-ref/env-common.xml b/doc/manual/command-ref/env-common.xml index 696d68c34..0217de7b2 100644 --- a/doc/manual/command-ref/env-common.xml +++ b/doc/manual/command-ref/env-common.xml @@ -33,7 +33,7 @@ will cause Nix to look for paths relative to <filename>/home/eelco/Dev</filename> and - <filename>/etc/nixos</filename>, in that order. It is also + <filename>/etc/nixos</filename>, in this order. It is also possible to match paths against a prefix. For example, the value <screen> @@ -59,7 +59,7 @@ nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/nixos-15.09.tar.gz</sc 15.09 channel.</para> <para>A following shorthand can be used to refer to the official channels: - + <screen>nixpkgs=channel:nixos-15.09</screen> </para> @@ -137,12 +137,19 @@ $ mount -o bind /mnt/otherdisk/nix /nix</screen> <varlistentry><term><envar>NIX_CONF_DIR</envar></term> - <listitem><para>Overrides the location of the Nix configuration + <listitem><para>Overrides the location of the system Nix configuration directory (default <filename><replaceable>prefix</replaceable>/etc/nix</filename>).</para></listitem> </varlistentry> +<varlistentry><term><envar>NIX_USER_CONF_FILES</envar></term> + + <listitem><para>Overrides the location of the user Nix configuration files + to load from (defaults to the XDG spec locations). The variable is treated + as a list separated by the <literal>:</literal> token.</para></listitem> + +</varlistentry> <varlistentry><term><envar>TMPDIR</envar></term> |