diff options
author | fricklerhandwerk <valentin@fricklerhandwerk.de> | 2023-06-17 03:53:37 +0200 |
---|---|---|
committer | Valentin Gagarin <valentin.gagarin@tweag.io> | 2023-06-20 12:11:01 +0200 |
commit | 38bd1cc9bc80e6dec59e56a7d1ce19379915a910 (patch) | |
tree | b9a7276d6eed0041f9f25b03a394e6ec27da0886 /doc/manual/src/command-ref | |
parent | f2b54e3b71891c29f951e46b00c6edc4807b3b63 (diff) |
split configuration file page into sections
this makes it easier to scan for specific information, such as the
format of command line flags
Diffstat (limited to 'doc/manual/src/command-ref')
-rw-r--r-- | doc/manual/src/command-ref/conf-file-prefix.md | 53 |
1 files changed, 32 insertions, 21 deletions
diff --git a/doc/manual/src/command-ref/conf-file-prefix.md b/doc/manual/src/command-ref/conf-file-prefix.md index d2989ff20..29325ee45 100644 --- a/doc/manual/src/command-ref/conf-file-prefix.md +++ b/doc/manual/src/command-ref/conf-file-prefix.md @@ -4,6 +4,10 @@ # Description +Nix supports a variety of configuration settings, which are read from configuration files or taken as command line flags. + +## Configuration file + By default Nix reads settings from the following places: - The system-wide configuration file `sysconfdir/nix/nix.conf` (i.e. `/etc/nix/nix.conf` on most systems), or `$NIX_CONF_DIR/nix.conf` if [`NIX_CONF_DIR`](./env-common.md#env-NIX_CONF_DIR) is set. @@ -18,32 +22,39 @@ By default Nix reads settings from the following places: - If [`NIX_CONFIG`](./env-common.md#env-NIX_CONFIG) is set, its contents are treated as the contents of a configuration file. -The configuration files consist of `name = value` pairs, one per -line. Other files can be included with a line like `include path`, -where *path* is interpreted relative to the current conf file and a -missing file is an error unless `!include` is used instead. Comments -start with a `#` character. +### File format + +Configuration files consist of `name = value` pairs, one per line. +Comments start with a `#` character. + +Example: + +``` +keep-outputs = true # Nice for developers +keep-derivations = true # Idem +``` + +Other files can be included with a line like `include <path>`, where `<path>` is interpreted relative to the current configuration file. +A missing file is an error unless `!include` is used instead. + +A configuration setting usually overrides any previous value. +However, you can prefix the name of the setting by `extra-` to *append* to the previous value. -Here is an example configuration file: +For instance, - keep-outputs = true # Nice for developers - keep-derivations = true # Idem +``` +substituters = a b +extra-substituters = c d +``` -You can override settings on the command line using the `--option` -flag, e.g. `--option keep-outputs false`. Every configuration setting -also has a corresponding command line flag, e.g. `--max-jobs 16`; for -Boolean settings, there are two flags to enable or disable the setting -(e.g. `--keep-failed` and `--no-keep-failed`). +defines the `substituters` setting to be `a b c d`. -A configuration setting usually overrides any previous value. However, -you can prefix the name of the setting by `extra-` to *append* to the -previous value. For instance, +## Command line flags - substituters = a b - extra-substituters = c d +Every configuration setting has a corresponding command line flag (e.g. `--max-jobs 16`). +Boolean settings do not need an argument, and can be explicitly disabled with the `no-` prefix (e.g. `--keep-failed` and `--no-keep-failed`). -defines the `substituters` setting to be `a b c d`. This is also -available as a command line flag (e.g. `--extra-substituters`). +Existing settings can be appended to using the `extra-` prefix (e.g. `--extra-substituters`). -The following settings are currently available: +# Available settings |