.\" -*- mode: troff; coding: utf-8 -*- .TH "nix.conf" "5" "" .SH Name .LP \f(CRnix.conf\fR - Nix configuration file .SH Description .LP Nix supports a variety of configuration settings, which are read from configuration files or taken as command line flags. .SS Configuration file .LP By default Nix reads settings from the following places, in that order: .IP "1." 3 The system-wide configuration file \f(CRsysconfdir/nix/nix.conf\fR (i.e. \f(CR/etc/nix/nix.conf\fR on most systems), or \f(CR$NIX_CONF_DIR/nix.conf\fR if \fB\f(CRNIX_CONF_DIR\fR\fR is set. .IP Values loaded in this file are not forwarded to the Nix daemon. The client assumes that the daemon has already loaded them. .IP "2." 3 If \fB\f(CRNIX_USER_CONF_FILES\fR\fR is set, then each path separated by \f(CR:\fR will be loaded in reverse order. .IP Otherwise it will look for \f(CRnix/nix.conf\fR files in \f(CRXDG_CONFIG_DIRS\fR and \fB\f(CRXDG_CONFIG_HOME\fR\fR. If unset, \f(CRXDG_CONFIG_DIRS\fR defaults to \f(CR/etc/xdg\fR, and \f(CRXDG_CONFIG_HOME\fR defaults to \f(CR$HOME/.config\fR as per \fBXDG Base Directory Specification\fR. .IP "3." 3 If \fB\f(CRNIX_CONFIG\fR\fR is set, its contents are treated as the contents of a configuration file. .SS File format .LP Configuration files consist of \f(CRname = value\fR pairs, one per line. Comments start with a \f(CR#\fR character. .PP Example: .LP .EX keep-outputs = true # Nice for developers keep-derivations = true # Idem .EE .PP Other files can be included with a line like \f(CRinclude \fR, where \f(CR\fR is interpreted relative to the current configuration file. A missing file is an error unless \f(CR!include\fR is used instead. .PP A configuration setting usually overrides any previous value. However, for settings that take a list of items, you can prefix the name of the setting by \f(CRextra-\fR to \fIappend\fR to the previous value. .PP For instance, .LP .EX substituters = a b extra-substituters = c d .EE .PP defines the \f(CRsubstituters\fR setting to be \f(CRa b c d\fR. .PP Unknown option names are not an error, and are simply ignored with a warning. .SS Command line flags .LP Configuration options can be set on the command line, overriding the values set in the \fBconfiguration file\fR: .IP "\(bu" 3 Every configuration setting has corresponding command line flag (e.g. \f(CR--max-jobs 16\fR). Boolean settings do not need an argument, and can be explicitly disabled with the \f(CRno-\fR prefix (e.g. \f(CR--keep-failed\fR and \f(CR--no-keep-failed\fR). .IP Unknown option names are invalid flags (unless there is already a flag with that name), and are rejected with an error. .IP "\(bu" 3 The flag \f(CR--option \fR is interpreted exactly like a \f(CR = \fR in a setting file. .IP Unknown option names are ignored with a warning. .LP The \f(CRextra-\fR prefix is supported for settings that take a list of items (e.g. \f(CR--extra-trusted users alice\fR or \f(CR--option extra-trusted-users alice\fR). .SH Available settings .IP "\(bu" 3 \fB\f(CRaccept-flake-config\fR\fR .IP Whether to accept nix configuration from a flake without prompting. .RS .IP \fBWarning\fR This setting is part of an \fBexperimental feature\fR. .RE .IP To change this setting, you need to make sure the corresponding experimental feature, \fB\f(CRflakes\fR\fR, is enabled. For example, include the following in \fB\f(CRnix.conf\fR\fR: .LP .EX extra-experimental-features = flakes accept-flake-config = ... .EE .IP \fBDefault:\fR \f(CRfalse\fR .IP "\(bu" 3 \fB\f(CRaccess-tokens\fR\fR .IP Access tokens used to access protected GitHub, GitLab, or other locations requiring token-based authentication. .IP Access tokens are specified as a string made up of space-separated \f(CRhost=token\fR values. The specific token used is selected by matching the \f(CRhost\fR portion against the \(lqhost\(rq specification of the input. The actual use of the \f(CRtoken\fR value is determined by the type of resource being accessed: .RS .IP "\(bu" 3 Github: the token value is the OAUTH-TOKEN string obtained as the Personal Access Token from the Github server (see \fIhttps://docs.github.com/en/developers/apps/building-oauth-apps/authorizing-oauth-apps\fR). .IP "\(bu" 3 Gitlab: the token value is either the OAuth2 token or the Personal Access Token (these are different types tokens for gitlab, see \fIhttps://docs.gitlab.com/12.10/ee/api/README.html#authentication\fR). The \f(CRtoken\fR value should be \f(CRtype:tokenstring\fR where \f(CRtype\fR is either \f(CROAuth2\fR or \f(CRPAT\fR to indicate which type of token is being specified. .RE .IP Example \f(CR\(ti/.config/nix/nix.conf\fR: .LP .EX access-tokens = github.com=23ac...b289 gitlab.mycompany.com=PAT:A123Bp_Cd..EfG gitlab.com=OAuth2:1jklw3jk .EE .IP Example \f(CR\(ti/code/flake.nix\fR: .LP .EX input.foo = { type = \(dqgitlab\(dq; host = \(dqgitlab.mycompany.com\(dq; owner = \(dqmycompany\(dq; repo = \(dqpro\(dq; }; .EE .IP This example specifies three tokens, one each for accessing github.com, gitlab.mycompany.com, and gitlab.com. .IP The \f(CRinput.foo\fR uses the \(lqgitlab\(rq fetcher, which might requires specifying the token type along with the token value. .IP \fBDefault:\fR \fIempty\fR .IP "\(bu" 3 \fB\f(CRallow-dirty\fR\fR .IP Whether to allow dirty Git/Mercurial trees. .IP \fBDefault:\fR \f(CRtrue\fR .IP "\(bu" 3 \fB\f(CRallow-import-from-derivation\fR\fR .IP By default, Nix allows you to \f(CRimport\fR from a derivation, allowing building at evaluation time. With this option set to false, Nix will throw an error when evaluating an expression that uses this feature, allowing users to ensure their evaluation will not require any builds to take place. .IP \fBDefault:\fR \f(CRtrue\fR .IP "\(bu" 3 \fB\f(CRallow-new-privileges\fR\fR .IP (Linux-specific.) By default, builders on Linux cannot acquire new privileges by calling setuid/setgid programs or programs that have file capabilities. For example, programs such as \f(CRsudo\fR or \f(CRping\fR will fail. (Note that in sandbox builds, no such programs are available unless you bind-mount them into the sandbox via the \f(CRsandbox-paths\fR option.) You can allow the use of such programs by enabling this option. This is impure and usually undesirable, but may be useful in certain scenarios (e.g. to spin up containers or set up userspace network interfaces in tests). .IP \fBDefault:\fR \f(CRfalse\fR .IP "\(bu" 3 \fB\f(CRallow-symlinked-store\fR\fR .IP If set to \f(CRtrue\fR, Nix will stop complaining if the store directory (typically /nix/store) contains symlink components. .IP This risks making some builds \(lqimpure\(rq because builders sometimes \(lqcanonicalise\(rq paths by resolving all symlink components. Problems occur if those builds are then deployed to machines where /nix/store resolves to a different location from that of the build machine. You can enable this setting if you are sure you\(cqre not going to do that. .IP \fBDefault:\fR \f(CRfalse\fR .IP "\(bu" 3 \fB\f(CRallow-unsafe-native-code-during-evaluation\fR\fR .IP Whether builtin functions that allow executing native code should be enabled. .IP \fBDefault:\fR \f(CRfalse\fR .IP "\(bu" 3 \fB\f(CRallowed-impure-host-deps\fR\fR .IP Which prefixes to allow derivations to ask for access to (primarily for Darwin). .IP \fBDefault:\fR \fIempty\fR .IP "\(bu" 3 \fB\f(CRallowed-uris\fR\fR .IP A list of URI prefixes to which access is allowed in restricted evaluation mode. For example, when set to \f(CRhttps://github.com/NixOS\fR, builtin functions such as \f(CRfetchGit\fR are allowed to access \f(CRhttps://github.com/NixOS/patchelf.git\fR. .IP \fBDefault:\fR \fIempty\fR .IP "\(bu" 3 \fB\f(CRallowed-users\fR\fR .IP A list user names, separated by whitespace. These users are allowed to connect to the Nix daemon. .IP You can specify groups by prefixing names with \f(CR@\fR. For instance, \f(CR@wheel\fR means all users in the \f(CRwheel\fR group. Also, you can allow all users by specifying \f(CR*\fR. .RS .IP \fBNote\fR .IP Trusted users (set in \fB\f(CRtrusted-users\fR\fR) can always connect to the Nix daemon. .RE .IP \fBDefault:\fR \f(CR*\fR .IP "\(bu" 3 \fB\f(CRauto-allocate-uids\fR\fR .IP Whether to select UIDs for builds automatically, instead of using the users in \f(CRbuild-users-group\fR. .IP UIDs are allocated starting at 872415232 (0x34000000) on Linux and 56930 on macOS. .IP \fBDefault:\fR \f(CRfalse\fR .IP "\(bu" 3 \fB\f(CRauto-optimise-store\fR\fR .IP If set to \f(CRtrue\fR, Nix automatically detects files in the store that have identical contents, and replaces them with hard links to a single copy. This saves disk space. If set to \f(CRfalse\fR (the default), you can still run \f(CRnix-store --optimise\fR to get rid of duplicate files. .IP \fBDefault:\fR \f(CRfalse\fR .IP "\(bu" 3 \fB\f(CRbash-prompt\fR\fR .IP The bash prompt (\f(CRPS1\fR) in \f(CRnix develop\fR shells. .IP \fBDefault:\fR \fIempty\fR .IP "\(bu" 3 \fB\f(CRbash-prompt-prefix\fR\fR .IP Prefix prepended to the \f(CRPS1\fR environment variable in \f(CRnix develop\fR shells. .IP \fBDefault:\fR \fIempty\fR .IP "\(bu" 3 \fB\f(CRbash-prompt-suffix\fR\fR .IP Suffix appended to the \f(CRPS1\fR environment variable in \f(CRnix develop\fR shells. .IP \fBDefault:\fR \fIempty\fR .IP "\(bu" 3 \fB\f(CRbuild-hook\fR\fR .IP The path to the helper program that executes remote builds. .IP Nix communicates with the build hook over \f(CRstdio\fR using a custom protocol to request builds that cannot be performed directly by the Nix daemon. The default value is the internal Nix binary that implements remote building. .RS .IP \fBImportant\fR .IP Change this setting only if you really know what you’re doing. .RE .IP \fBDefault:\fR \fIempty\fR .IP "\(bu" 3 \fB\f(CRbuild-poll-interval\fR\fR .IP How often (in seconds) to poll for locks. .IP \fBDefault:\fR \f(CR5\fR .IP "\(bu" 3 \fB\f(CRbuild-users-group\fR\fR .IP This options specifies the Unix group containing the Nix build user accounts. In multi-user Nix installations, builds should not be performed by the Nix account since that would allow users to arbitrarily modify the Nix store and database by supplying specially crafted builders; and they cannot be performed by the calling user since that would allow him/her to influence the build result. .IP Therefore, if this option is non-empty and specifies a valid group, builds will be performed under the user accounts that are a member of the group specified here (as listed in \f(CR/etc/group\fR). Those user accounts should not be used for any other purpose! .IP Nix will never run two builds under the same user account at the same time. This is to prevent an obvious security hole: a malicious user writing a Nix expression that modifies the build result of a legitimate Nix expression being built by another user. Therefore it is good to have as many Nix build user accounts as you can spare. (Remember: uids are cheap.) .IP The build users should have permission to create files in the Nix store, but not delete them. Therefore, \f(CR/nix/store\fR should be owned by the Nix account, its group should be the group specified here, and its mode should be \f(CR1775\fR. .IP If the build users group is empty, builds will be performed under the uid of the Nix process (that is, the uid of the caller if \f(CRNIX_REMOTE\fR is empty, the uid under which the Nix daemon runs if \f(CRNIX_REMOTE\fR is \f(CRdaemon\fR). Obviously, this should not be used with a nix daemon accessible to untrusted clients. .IP Defaults to \f(CRnixbld\fR when running as root, \fIempty\fR otherwise. .IP \fBDefault:\fR \fImachine-specific\fR .IP "\(bu" 3 \fB\f(CRbuilders\fR\fR .IP A semicolon-separated list of build machines. For the exact format and examples, see \fBthe manual chapter on remote builds\fR .IP \fBDefault:\fR \f(CR@/dummy/machines\fR .IP "\(bu" 3 \fB\f(CRbuilders-use-substitutes\fR\fR .IP If set to \f(CRtrue\fR, Nix will instruct remote build machines to use their own binary substitutes if available. In practical terms, this means that remote hosts will fetch as many build dependencies as possible from their own substitutes (e.g, from \f(CRcache.nixos.org\fR), instead of waiting for this host to upload them all. This can drastically reduce build times if the network connection between this computer and the remote build host is slow. .IP \fBDefault:\fR \f(CRfalse\fR .IP "\(bu" 3 \fB\f(CRcommit-lockfile-summary\fR\fR .IP The commit summary to use when committing changed flake lock files. If empty, the summary is generated based on the action performed. .RS .IP \fBWarning\fR This setting is part of an \fBexperimental feature\fR. .RE .IP To change this setting, you need to make sure the corresponding experimental feature, \fB\f(CRflakes\fR\fR, is enabled. For example, include the following in \fB\f(CRnix.conf\fR\fR: .LP .EX extra-experimental-features = flakes commit-lockfile-summary = ... .EE .IP \fBDefault:\fR \fIempty\fR .IP "\(bu" 3 \fB\f(CRcompress-build-log\fR\fR .IP If set to \f(CRtrue\fR (the default), build logs written to \f(CR/nix/var/log/nix/drvs\fR will be compressed on the fly using bzip2. Otherwise, they will not be compressed. .IP \fBDefault:\fR \f(CRtrue\fR .IP \fBDeprecated alias:\fR \f(CRbuild-compress-log\fR .IP "\(bu" 3 \fB\f(CRconnect-timeout\fR\fR .IP The timeout (in seconds) for establishing connections in the binary cache substituter. It corresponds to \f(CRcurl\fR’s \f(CR--connect-timeout\fR option. A value of 0 means no limit. .IP \fBDefault:\fR \f(CR0\fR .IP "\(bu" 3 \fB\f(CRcores\fR\fR .IP Sets the value of the \f(CRNIX_BUILD_CORES\fR environment variable in the invocation of builders. Builders can use this variable at their discretion to control the maximum amount of parallelism. For instance, in Nixpkgs, if the derivation attribute \f(CRenableParallelBuilding\fR is set to \f(CRtrue\fR, the builder passes the \f(CR-jN\fR flag to GNU Make. It can be overridden using the \f(CR--cores\fR command line switch and defaults to \f(CR1\fR. The value \f(CR0\fR means that the builder should use all available CPU cores in the system. .IP \fBDefault:\fR \fImachine-specific\fR .IP \fBDeprecated alias:\fR \f(CRbuild-cores\fR .IP "\(bu" 3 \fB\f(CRdiff-hook\fR\fR .IP Absolute path to an executable capable of diffing build results. The hook is executed if \f(CRrun-diff-hook\fR is true, and the output of a build is known to not be the same. This program is not executed to determine if two results are the same. .IP The diff hook is executed by the same user and group who ran the build. However, the diff hook does not have write access to the store path just built. .IP The diff hook program receives three parameters: .RS .IP "1." 3 A path to the previous build\(cqs results .IP "2." 3 A path to the current build\(cqs results .IP "3." 3 The path to the build\(cqs derivation .IP "4." 3 The path to the build\(cqs scratch directory. This directory will exist only if the build was run with \f(CR--keep-failed\fR. .RE .IP The stderr and stdout output from the diff hook will not be displayed to the user. Instead, it will print to the nix-daemon\(cqs log. .IP When using the Nix daemon, \f(CRdiff-hook\fR must be set in the \f(CRnix.conf\fR configuration file, and cannot be passed at the command line. .IP \fBDefault:\fR \(ga\(ga .IP "\(bu" 3 \fB\f(CRdownload-attempts\fR\fR .IP How often Nix will attempt to download a file before giving up. .IP \fBDefault:\fR \f(CR5\fR .IP "\(bu" 3 \fB\f(CRdownload-speed\fR\fR .IP Specify the maximum transfer rate in kilobytes per second you want Nix to use for downloads. .IP \fBDefault:\fR \f(CR0\fR .IP "\(bu" 3 \fB\f(CReval-cache\fR\fR .IP Whether to use the flake evaluation cache. .IP \fBDefault:\fR \f(CRtrue\fR .IP "\(bu" 3 \fB\f(CRexperimental-features\fR\fR .IP Experimental features that are enabled. .IP Example: .LP .EX experimental-features = nix-command flakes .EE .IP The following experimental features are available: .RS .IP "\(bu" 3 \fB\f(CRauto-allocate-uids\fR\fR .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 \fB\f(CRca-derivations\fR\fR .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 \fB\f(CRcgroups\fR\fR .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 \fB\f(CRdaemon-trust-override\fR\fR .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 \fB\f(CRdynamic-derivations\fR\fR .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 \fB\f(CRfetch-closure\fR\fR .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 \fB\f(CRflakes\fR\fR .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 \fB\f(CRimpure-derivations\fR\fR .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 \fB\f(CRnix-command\fR\fR .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 \fB\f(CRno-url-literals\fR\fR .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 \fB\f(CRparse-toml-timestamps\fR\fR .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 \fB\f(CRread-only-local-store\fR\fR .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 \fB\f(CRrecursive-nix\fR\fR .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 \fB\f(CRrepl-flake\fR\fR .RE .IP Experimental features are \fBfurther documented in the manual\fR. .IP \fBDefault:\fR \fIempty\fR .IP "\(bu" 3 \fB\f(CRextra-platforms\fR\fR .IP System types of executables that can be run on this machine. .IP Nix will only build a given \fBderivation\fR locally when its \f(CRsystem\fR attribute equals any of the values specified here or in the \fB\f(CRsystem\fR option\fR. .IP Setting this can be useful to build derivations locally on compatible machines: .RS .IP "\(bu" 3 \f(CRi686-linux\fR executables can be run on \f(CRx86_64-linux\fR machines (set by default) .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 \f(CRx86_64-darwin\fR executables can be run on macOS \f(CRaarch64-darwin\fR with Rosetta 2 (set by default where applicable) .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 \f(CRarmv6\fR and \f(CRarmv5tel\fR executables can be run on \f(CRarmv7\fR .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 some \f(CRaarch64\fR machines can also natively run 32-bit ARM code .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 \f(CRqemu-user\fR may be used to support non-native platforms (though this may be slow and buggy) .RE .IP Build systems will usually detect the target platform to be the current physical system and therefore produce machine code incompatible with what may be intended in the derivation. You should design your derivation\(cqs \f(CRbuilder\fR accordingly and cross-check the results when using this option against natively-built versions of your derivation. .IP \fBDefault:\fR \fImachine-specific\fR .IP "\(bu" 3 \fB\f(CRfallback\fR\fR .IP If set to \f(CRtrue\fR, Nix will fall back to building from source if a binary substitute fails. This is equivalent to the \f(CR--fallback\fR flag. The default is \f(CRfalse\fR. .IP \fBDefault:\fR \f(CRfalse\fR .IP \fBDeprecated alias:\fR \f(CRbuild-fallback\fR .IP "\(bu" 3 \fB\f(CRfilter-syscalls\fR\fR .IP Whether to prevent certain dangerous system calls, such as creation of setuid/setgid files or adding ACLs or extended attributes. Only disable this if you\(cqre aware of the security implications. .IP \fBDefault:\fR \f(CRtrue\fR .IP "\(bu" 3 \fB\f(CRflake-registry\fR\fR .IP Path or URI of the global flake registry. .IP When empty, disables the global flake registry. .RS .IP \fBWarning\fR This setting is part of an \fBexperimental feature\fR. .RE .IP To change this setting, you need to make sure the corresponding experimental feature, \fB\f(CRflakes\fR\fR, is enabled. For example, include the following in \fB\f(CRnix.conf\fR\fR: .LP .EX extra-experimental-features = flakes flake-registry = ... .EE .IP \fBDefault:\fR \f(CRhttps://channels.nixos.org/flake-registry.json\fR .IP "\(bu" 3 \fB\f(CRfsync-metadata\fR\fR .IP If set to \f(CRtrue\fR, changes to the Nix store metadata (in \f(CR/nix/var/nix/db\fR) are synchronously flushed to disk. This improves robustness in case of system crashes, but reduces performance. The default is \f(CRtrue\fR. .IP \fBDefault:\fR \f(CRtrue\fR .IP "\(bu" 3 \fB\f(CRgc-reserved-space\fR\fR .IP Amount of reserved disk space for the garbage collector. .IP \fBDefault:\fR \f(CR8388608\fR .IP "\(bu" 3 \fB\f(CRhashed-mirrors\fR\fR .IP A list of web servers used by \f(CRbuiltins.fetchurl\fR to obtain files by hash. Given a hash type \fIht\fR and a base-16 hash \fIh\fR, Nix will try to download the file from \fIhashed-mirror\fR/\fIht\fR/\fIh\fR. This allows files to be downloaded even if they have disappeared from their original URI. For example, given an example mirror \f(CRhttp://tarballs.nixos.org/\fR, when building the derivation .LP .EX builtins.fetchurl { url = \(dqhttps://example.org/foo-1.2.3.tar.xz\(dq; sha256 = \(dq2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae\(dq; } .EE .IP Nix will attempt to download this file from \f(CRhttp://tarballs.nixos.org/sha256/2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae\fR first. If it is not available there, if will try the original URI. .IP \fBDefault:\fR \fIempty\fR .IP "\(bu" 3 \fB\f(CRhttp-connections\fR\fR .IP The maximum number of parallel TCP connections used to fetch files from binary caches and by other downloads. It defaults to 25. 0 means no limit. .IP \fBDefault:\fR \f(CR25\fR .IP \fBDeprecated alias:\fR \f(CRbinary-caches-parallel-connections\fR .IP "\(bu" 3 \fB\f(CRhttp2\fR\fR .IP Whether to enable HTTP/2 support. .IP \fBDefault:\fR \f(CRtrue\fR .IP "\(bu" 3 \fB\f(CRid-count\fR\fR .IP The number of UIDs/GIDs to use for dynamic ID allocation. .IP \fBDefault:\fR \f(CR8388608\fR .IP "\(bu" 3 \fB\f(CRignore-try\fR\fR .IP If set to true, ignore exceptions inside \(oqtryEval\(cq calls when evaluating nix expressions in debug mode (using the \(endebugger flag). By default the debugger will pause on all exceptions. .IP \fBDefault:\fR \f(CRfalse\fR .IP "\(bu" 3 \fB\f(CRignored-acls\fR\fR .IP A list of ACLs that should be ignored, normally Nix attempts to remove all ACLs from files and directories in the Nix store, but some ACLs like \f(CRsecurity.selinux\fR or \f(CRsystem.nfs4_acl\fR can\(cqt be removed even by root. Therefore it\(cqs best to just ignore them. .IP \fBDefault:\fR \f(CRsecurity.csm security.selinux system.nfs4_acl\fR .IP "\(bu" 3 \fB\f(CRimpersonate-linux-26\fR\fR .IP Whether to impersonate a Linux 2.6 machine on newer kernels. .IP \fBDefault:\fR \f(CRfalse\fR .IP \fBDeprecated alias:\fR \f(CRbuild-impersonate-linux-26\fR .IP "\(bu" 3 \fB\f(CRkeep-build-log\fR\fR .IP If set to \f(CRtrue\fR (the default), Nix will write the build log of a derivation (i.e. the standard output and error of its builder) to the directory \f(CR/nix/var/log/nix/drvs\fR. The build log can be retrieved using the command \f(CRnix-store -l path\fR. .IP \fBDefault:\fR \f(CRtrue\fR .IP \fBDeprecated alias:\fR \f(CRbuild-keep-log\fR .IP "\(bu" 3 \fB\f(CRkeep-derivations\fR\fR .IP If \f(CRtrue\fR (default), the garbage collector will keep the derivations from which non-garbage store paths were built. If \f(CRfalse\fR, they will be deleted unless explicitly registered as a root (or reachable from other roots). .IP Keeping derivation around is useful for querying and traceability (e.g., it allows you to ask with what dependencies or options a store path was built), so by default this option is on. Turn it off to save a bit of disk space (or a lot if \f(CRkeep-outputs\fR is also turned on). .IP \fBDefault:\fR \f(CRtrue\fR .IP \fBDeprecated alias:\fR \f(CRgc-keep-derivations\fR .IP "\(bu" 3 \fB\f(CRkeep-env-derivations\fR\fR .IP If \f(CRfalse\fR (default), derivations are not stored in Nix user environments. That is, the derivations of any build-time-only dependencies may be garbage-collected. .IP If \f(CRtrue\fR, when you add a Nix derivation to a user environment, the path of the derivation is stored in the user environment. Thus, the derivation will not be garbage-collected until the user environment generation is deleted (\f(CRnix-env --delete-generations\fR). To prevent build-time-only dependencies from being collected, you should also turn on \f(CRkeep-outputs\fR. .IP The difference between this option and \f(CRkeep-derivations\fR is that this one is “sticky”: it applies to any user environment created while this option was enabled, while \f(CRkeep-derivations\fR only applies at the moment the garbage collector is run. .IP \fBDefault:\fR \f(CRfalse\fR .IP \fBDeprecated alias:\fR \f(CRenv-keep-derivations\fR .IP "\(bu" 3 \fB\f(CRkeep-failed\fR\fR .IP Whether to keep temporary directories of failed builds. .IP \fBDefault:\fR \f(CRfalse\fR .IP "\(bu" 3 \fB\f(CRkeep-going\fR\fR .IP Whether to keep building derivations when another build fails. .IP \fBDefault:\fR \f(CRfalse\fR .IP "\(bu" 3 \fB\f(CRkeep-outputs\fR\fR .IP If \f(CRtrue\fR, the garbage collector will keep the outputs of non-garbage derivations. If \f(CRfalse\fR (default), outputs will be deleted unless they are GC roots themselves (or reachable from other roots). .IP In general, outputs must be registered as roots separately. However, even if the output of a derivation is registered as a root, the collector will still delete store paths that are used only at build time (e.g., the C compiler, or source tarballs downloaded from the network). To prevent it from doing so, set this option to \f(CRtrue\fR. .IP \fBDefault:\fR \f(CRfalse\fR .IP \fBDeprecated alias:\fR \f(CRgc-keep-outputs\fR .IP "\(bu" 3 \fB\f(CRlog-lines\fR\fR .IP The number of lines of the tail of the log to show if a build fails. .IP \fBDefault:\fR \f(CR10\fR .IP "\(bu" 3 \fB\f(CRmax-build-log-size\fR\fR .IP This option defines the maximum number of bytes that a builder can write to its stdout/stderr. If the builder exceeds this limit, it’s killed. A value of \f(CR0\fR (the default) means that there is no limit. .IP \fBDefault:\fR \f(CR0\fR .IP \fBDeprecated alias:\fR \f(CRbuild-max-log-size\fR .IP "\(bu" 3 \fB\f(CRmax-free\fR\fR .IP When a garbage collection is triggered by the \f(CRmin-free\fR option, it stops as soon as \f(CRmax-free\fR bytes are available. The default is infinity (i.e. delete all garbage). .IP \fBDefault:\fR \f(CR-1\fR .IP "\(bu" 3 \fB\f(CRmax-jobs\fR\fR .IP This option defines the maximum number of jobs that Nix will try to build in parallel. The default is \f(CR1\fR. The special value \f(CRauto\fR causes Nix to use the number of CPUs in your system. \f(CR0\fR is useful when using remote builders to prevent any local builds (except for \f(CRpreferLocalBuild\fR derivation attribute which executes locally regardless). It can be overridden using the \f(CR--max-jobs\fR (\f(CR-j\fR) command line switch. .IP \fBDefault:\fR \f(CR1\fR .IP \fBDeprecated alias:\fR \f(CRbuild-max-jobs\fR .IP "\(bu" 3 \fB\f(CRmax-silent-time\fR\fR .IP This option defines the maximum number of seconds that a builder can go without producing any data on standard output or standard error. This is useful (for instance in an automated build system) to catch builds that are stuck in an infinite loop, or to catch remote builds that are hanging due to network problems. It can be overridden using the \f(CR--max-silent-time\fR command line switch. .IP The value \f(CR0\fR means that there is no timeout. This is also the default. .IP \fBDefault:\fR \f(CR0\fR .IP \fBDeprecated alias:\fR \f(CRbuild-max-silent-time\fR .IP "\(bu" 3 \fB\f(CRmax-substitution-jobs\fR\fR .IP This option defines the maximum number of substitution jobs that Nix will try to run in parallel. The default is \f(CR16\fR. The minimum value one can choose is \f(CR1\fR and lower values will be interpreted as \f(CR1\fR. .IP \fBDefault:\fR \f(CR16\fR .IP \fBDeprecated alias:\fR \f(CRsubstitution-max-jobs\fR .IP "\(bu" 3 \fB\f(CRmin-free\fR\fR .IP When free disk space in \f(CR/nix/store\fR drops below \f(CRmin-free\fR during a build, Nix performs a garbage-collection until \f(CRmax-free\fR bytes are available or there is no more garbage. A value of \f(CR0\fR (the default) disables this feature. .IP \fBDefault:\fR \f(CR0\fR .IP "\(bu" 3 \fB\f(CRmin-free-check-interval\fR\fR .IP Number of seconds between checking free disk space. .IP \fBDefault:\fR \f(CR5\fR .IP "\(bu" 3 \fB\f(CRnar-buffer-size\fR\fR .IP Maximum size of NARs before spilling them to disk. .IP \fBDefault:\fR \f(CR33554432\fR .IP "\(bu" 3 \fB\f(CRnarinfo-cache-negative-ttl\fR\fR .IP The TTL in seconds for negative lookups. If a store path is queried from a substituter but was not found, there will be a negative lookup cached in the local disk cache database for the specified duration. .IP \fBDefault:\fR \f(CR3600\fR .IP "\(bu" 3 \fB\f(CRnarinfo-cache-positive-ttl\fR\fR .IP The TTL in seconds for positive lookups. If a store path is queried from a substituter, the result of the query will be cached in the local disk cache database including some of the NAR metadata. The default TTL is a month, setting a shorter TTL for positive lookups can be useful for binary caches that have frequent garbage collection, in which case having a more frequent cache invalidation would prevent trying to pull the path again and failing with a hash mismatch if the build isn\(cqt reproducible. .IP \fBDefault:\fR \f(CR2592000\fR .IP "\(bu" 3 \fB\f(CRnetrc-file\fR\fR .IP If set to an absolute path to a \f(CRnetrc\fR file, Nix will use the HTTP authentication credentials in this file when trying to download from a remote host through HTTP or HTTPS. Defaults to \f(CR$NIX_CONF_DIR/netrc\fR. .IP The \f(CRnetrc\fR file consists of a list of accounts in the following format: .IP machine my-machine login my-username password my-password .IP For the exact syntax, see \fBthe \f(CRcurl\fR documentation\fR. .RS .IP \fBNote\fR .IP This must be an absolute path, and \f(CR\(ti\fR is not resolved. For example, \f(CR\(ti/.netrc\fR won\(cqt resolve to your home directory\(cqs \f(CR.netrc\fR. .RE .IP \fBDefault:\fR \f(CR/dummy/netrc\fR .IP "\(bu" 3 \fB\f(CRnix-path\fR\fR .IP List of directories to be searched for \f(CR<...>\fR file references .IP In particular, outside of \fBpure evaluation mode\fR, this determines the value of \fB\f(CRbuiltins.nixPath\fR\fR. .IP \fBDefault:\fR \fIempty\fR .IP "\(bu" 3 \fB\f(CRplugin-files\fR\fR .IP A list of plugin files to be loaded by Nix. Each of these files will be dlopened by Nix, allowing them to affect execution through static initialization. In particular, these plugins may construct static instances of RegisterPrimOp to add new primops or constants to the expression language, RegisterStoreImplementation to add new store implementations, RegisterCommand to add new subcommands to the \f(CRnix\fR command, and RegisterSetting to add new nix config settings. See the constructors for those types for more details. .IP Warning! These APIs are inherently unstable and may change from release to release. .IP Since these files are loaded into the same address space as Nix itself, they must be DSOs compatible with the instance of Nix running at the time (i.e. compiled against the same headers, not linked to any incompatible libraries). They should not be linked to any Nix libs directly, as those will be available already at load time. .IP If an entry in the list is a directory, all files in the directory are loaded as plugins (non-recursively). .IP \fBDefault:\fR \fIempty\fR .IP "\(bu" 3 \fB\f(CRpost-build-hook\fR\fR .IP Optional. The path to a program to execute after each build. .IP This option is only settable in the global \f(CRnix.conf\fR, or on the command line by trusted users. .IP When using the nix-daemon, the daemon executes the hook as \f(CRroot\fR. If the nix-daemon is not involved, the hook runs as the user executing the nix-build. .RS .IP "\(bu" 3 The hook executes after an evaluation-time build. .IP "\(bu" 3 The hook does not execute on substituted paths. .IP "\(bu" 3 The hook\(cqs output always goes to the user\(cqs terminal. .IP "\(bu" 3 If the hook fails, the build succeeds but no further builds execute. .IP "\(bu" 3 The hook executes synchronously, and blocks other builds from progressing while it runs. .RE .IP The program executes with no arguments. The program\(cqs environment contains the following environment variables: .RS .IP "\(bu" 3 \f(CRDRV_PATH\fR The derivation for the built paths. .IP Example: \f(CR/nix/store/5nihn1a7pa8b25l9zafqaqibznlvvp3f-bash-4.4-p23.drv\fR .IP "\(bu" 3 \f(CROUT_PATHS\fR Output paths of the built derivation, separated by a space character. .IP Example: \f(CR/nix/store/zf5lbh336mnzf1nlswdn11g4n2m8zh3g-bash-4.4-p23-dev /nix/store/rjxwxwv1fpn9wa2x5ssk5phzwlcv4mna-bash-4.4-p23-doc /nix/store/6bqvbzjkcp9695dq0dpl5y43nvy37pq1-bash-4.4-p23-info /nix/store/r7fng3kk3vlpdlh2idnrbn37vh4imlj2-bash-4.4-p23-man /nix/store/xfghy8ixrhz3kyy6p724iv3cxji088dx-bash-4.4-p23\fR. .RE .IP \fBDefault:\fR \fIempty\fR .IP "\(bu" 3 \fB\f(CRpre-build-hook\fR\fR .IP If set, the path to a program that can set extra derivation-specific settings for this system. This is used for settings that can\(cqt be captured by the derivation model itself and are too variable between different versions of the same system to be hard-coded into nix. .IP The hook is passed the derivation path and, if sandboxes are enabled, the sandbox directory. It can then modify the sandbox and send a series of commands to modify various settings to stdout. The currently recognized commands are: .RS .IP "\(bu" 3 \f(CRextra-sandbox-paths\fR .br Pass a list of files and directories to be included in the sandbox for this build. One entry per line, terminated by an empty line. Entries have the same format as \f(CRsandbox-paths\fR. .RE .IP \fBDefault:\fR \fIempty\fR .IP "\(bu" 3 \fB\f(CRpreallocate-contents\fR\fR .IP Whether to preallocate files when writing objects with known size. .IP \fBDefault:\fR \f(CRfalse\fR .IP "\(bu" 3 \fB\f(CRprint-missing\fR\fR .IP Whether to print what paths need to be built or downloaded. .IP \fBDefault:\fR \f(CRtrue\fR .IP "\(bu" 3 \fB\f(CRpure-eval\fR\fR .IP Pure evaluation mode ensures that the result of Nix expressions is fully determined by explicitly declared inputs, and not influenced by external state: .RS .IP "\(bu" 3 Restrict file system and network access to files specified by cryptographic hash .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 Disable \fB\f(CRbultins.currentSystem\fR\fR and \fB\f(CRbuiltins.currentTime\fR\fR .RE .IP \fBDefault:\fR \f(CRfalse\fR .IP "\(bu" 3 \fB\f(CRrequire-drop-supplementary-groups\fR\fR .IP Following the principle of least privilege, Nix will attempt to drop supplementary groups when building with sandboxing. .IP However this can fail under some circumstances. For example, if the user lacks the \f(CRCAP_SETGID\fR capability. Search \f(CRsetgroups(2)\fR for \f(CREPERM\fR to find more detailed information on this. .IP If you encounter such a failure, setting this option to \f(CRfalse\fR will let you ignore it and continue. But before doing so, you should consider the security implications carefully. Not dropping supplementary groups means the build sandbox will be less restricted than intended. .IP This option defaults to \f(CRtrue\fR when the user is root (since \f(CRroot\fR usually has permissions to call setgroups) and \f(CRfalse\fR otherwise. .IP \fBDefault:\fR \f(CRfalse\fR .IP "\(bu" 3 \fB\f(CRrequire-sigs\fR\fR .IP If set to \f(CRtrue\fR (the default), any non-content-addressed path added or copied to the Nix store (e.g. when substituting from a binary cache) must have a signature by a trusted key. A trusted key is one listed in \f(CRtrusted-public-keys\fR, or a public key counterpart to a private key stored in a file listed in \f(CRsecret-key-files\fR. .IP Set to \f(CRfalse\fR to disable signature checking and trust all non-content-addressed paths unconditionally. .IP (Content-addressed paths are inherently trustworthy and thus unaffected by this configuration option.) .IP \fBDefault:\fR \f(CRtrue\fR .IP "\(bu" 3 \fB\f(CRrestrict-eval\fR\fR .IP If set to \f(CRtrue\fR, the Nix evaluator will not allow access to any files outside of the Nix search path (as set via the \f(CRNIX_PATH\fR environment variable or the \f(CR-I\fR option), or to URIs outside of \fB\f(CRallowed-uris\fR\fR. The default is \f(CRfalse\fR. .IP \fBDefault:\fR \f(CRfalse\fR .IP "\(bu" 3 \fB\f(CRrun-diff-hook\fR\fR .IP If true, enable the execution of the \f(CRdiff-hook\fR program. .IP When using the Nix daemon, \f(CRrun-diff-hook\fR must be set in the \f(CRnix.conf\fR configuration file, and cannot be passed at the command line. .IP \fBDefault:\fR \f(CRfalse\fR .IP "\(bu" 3 \fB\f(CRsandbox\fR\fR .IP If set to \f(CRtrue\fR, builds will be performed in a \fIsandboxed environment\fR, i.e., they’re isolated from the normal file system hierarchy and will only see their dependencies in the Nix store, the temporary build directory, private versions of \f(CR/proc\fR, \f(CR/dev\fR, \f(CR/dev/shm\fR and \f(CR/dev/pts\fR (on Linux), and the paths configured with the \f(CRsandbox-paths\fR option. This is useful to prevent undeclared dependencies on files in directories such as \f(CR/usr/bin\fR. In addition, on Linux, builds run in private PID, mount, network, IPC and UTS namespaces to isolate them from other processes in the system (except that fixed-output derivations do not run in private network namespace to ensure they can access the network). .IP Currently, sandboxing only work on Linux and macOS. The use of a sandbox requires that Nix is run as root (so you should use the “build users” feature to perform the actual builds under different users than root). .IP If this option is set to \f(CRrelaxed\fR, then fixed-output derivations and derivations that have the \f(CR__noChroot\fR attribute set to \f(CRtrue\fR do not run in sandboxes. .IP The default is \f(CRtrue\fR on Linux and \f(CRfalse\fR on all other platforms. .IP \fBDefault:\fR \f(CRtrue\fR .IP \fBDeprecated alias:\fR \f(CRbuild-use-chroot\fR, \f(CRbuild-use-sandbox\fR .IP "\(bu" 3 \fB\f(CRsandbox-build-dir\fR\fR .IP The build directory inside the sandbox. .IP \fBDefault:\fR \f(CR/build\fR .IP "\(bu" 3 \fB\f(CRsandbox-dev-shm-size\fR\fR .IP This option determines the maximum size of the \f(CRtmpfs\fR filesystem mounted on \f(CR/dev/shm\fR in Linux sandboxes. For the format, see the description of the \f(CRsize\fR option of \f(CRtmpfs\fR in mount(8). The default is \f(CR50%\fR. .IP \fBDefault:\fR \f(CR50%\fR .IP "\(bu" 3 \fB\f(CRsandbox-fallback\fR\fR .IP Whether to disable sandboxing when the kernel doesn\(cqt allow it. .IP \fBDefault:\fR \f(CRtrue\fR .IP "\(bu" 3 \fB\f(CRsandbox-paths\fR\fR .IP A list of paths bind-mounted into Nix sandbox environments. You can use the syntax \f(CRtarget=source\fR to mount a path in a different location in the sandbox; for instance, \f(CR/bin=/nix-bin\fR will mount the path \f(CR/nix-bin\fR as \f(CR/bin\fR inside the sandbox. If \fIsource\fR is followed by \f(CR?\fR, then it is not an error if \fIsource\fR does not exist; for example, \f(CR/dev/nvidiactl?\fR specifies that \f(CR/dev/nvidiactl\fR will only be mounted in the sandbox if it exists in the host filesystem. .IP If the source is in the Nix store, then its closure will be added to the sandbox as well. .IP Depending on how Nix was built, the default value for this option may be empty or provide \f(CR/bin/sh\fR as a bind-mount of \f(CRbash\fR. .IP \fBDefault:\fR \fIempty\fR .IP \fBDeprecated alias:\fR \f(CRbuild-chroot-dirs\fR, \f(CRbuild-sandbox-paths\fR .IP "\(bu" 3 \fB\f(CRsecret-key-files\fR\fR .IP A whitespace-separated list of files containing secret (private) keys. These are used to sign locally-built paths. They can be generated using \f(CRnix-store --generate-binary-cache-key\fR. The corresponding public key can be distributed to other users, who can add it to \f(CRtrusted-public-keys\fR in their \f(CRnix.conf\fR. .IP \fBDefault:\fR \fIempty\fR .IP "\(bu" 3 \fB\f(CRshow-trace\fR\fR .IP Whether Nix should print out a stack trace in case of Nix expression evaluation errors. .IP \fBDefault:\fR \f(CRfalse\fR .IP "\(bu" 3 \fB\f(CRssl-cert-file\fR\fR .IP The path of a file containing CA certificates used to authenticate \f(CRhttps://\fR downloads. Nix by default will use the first of the following files that exists: .RS .IP "1." 3 \f(CR/etc/ssl/certs/ca-certificates.crt\fR .if n \ .sp -1 .if t \ .sp -0.25v .IP "2." 3 \f(CR/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt\fR .RE .IP The path can be overridden by the following environment variables, in order of precedence: .RS .IP "1." 3 \f(CRNIX_SSL_CERT_FILE\fR .if n \ .sp -1 .if t \ .sp -0.25v .IP "2." 3 \f(CRSSL_CERT_FILE\fR .RE .IP \fBDefault:\fR \f(CR/etc/ssl/certs/ca-certificates.crt\fR .IP "\(bu" 3 \fB\f(CRstalled-download-timeout\fR\fR .IP The timeout (in seconds) for receiving data from servers during download. Nix cancels idle downloads after this timeout\(cqs duration. .IP \fBDefault:\fR \f(CR300\fR .IP "\(bu" 3 \fB\f(CRstart-id\fR\fR .IP The first UID and GID to use for dynamic ID allocation. .IP \fBDefault:\fR \f(CR872415232\fR .IP "\(bu" 3 \fB\f(CRstore\fR\fR .IP The \fBURL of the Nix store\fR to use for most operations. See \fB\f(CRnix help-stores\fR\fR for supported store types and settings. .IP \fBDefault:\fR \f(CRauto\fR .IP "\(bu" 3 \fB\f(CRsubstitute\fR\fR .IP If set to \f(CRtrue\fR (default), Nix will use binary substitutes if available. This option can be disabled to force building from source. .IP \fBDefault:\fR \f(CRtrue\fR .IP \fBDeprecated alias:\fR \f(CRbuild-use-substitutes\fR .IP "\(bu" 3 \fB\f(CRsubstituters\fR\fR .IP A list of \fBURLs of Nix stores\fR to be used as substituters, separated by whitespace. A substituter is an additional [store]{@docroot@/glossary.md##gloss-store} from which Nix can obtain \fBstore objects\fR instead of building them. .IP Substituters are tried based on their priority value, which each substituter can set independently. Lower value means higher priority. The default is \f(CRhttps://cache.nixos.org\fR, which has a priority of 40. .IP At least one of the following conditions must be met for Nix to use a substituter: .RS .IP "\(bu" 3 The substituter is in the \fB\f(CRtrusted-substituters\fR\fR list .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 The user calling Nix is in the \fB\f(CRtrusted-users\fR\fR list .RE .IP In addition, each store path should be trusted as described in \fB\f(CRtrusted-public-keys\fR\fR .IP \fBDefault:\fR \f(CRhttps://cache.nixos.org/\fR .IP \fBDeprecated alias:\fR \f(CRbinary-caches\fR .IP "\(bu" 3 \fB\f(CRsync-before-registering\fR\fR .IP Whether to call \f(CRsync()\fR before registering a path as valid. .IP \fBDefault:\fR \f(CRfalse\fR .IP "\(bu" 3 \fB\f(CRsystem\fR\fR .IP The system type of the current Nix installation. Nix will only build a given \fBderivation\fR locally when its \f(CRsystem\fR attribute equals any of the values specified here or in \fB\f(CRextra-platforms\fR\fR. .IP The default value is set when Nix itself is compiled for the system it will run on. The following system types are widely used, as \fBNix is actively supported on these platforms\fR: .RS .IP "\(bu" 3 \f(CRx86_64-linux\fR .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 \f(CRx86_64-darwin\fR .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 \f(CRi686-linux\fR .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 \f(CRaarch64-linux\fR .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 \f(CRaarch64-darwin\fR .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 \f(CRarmv6l-linux\fR .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 \f(CRarmv7l-linux\fR .RE .IP In general, you do not have to modify this setting. While you can force Nix to run a Darwin-specific \f(CRbuilder\fR executable on a Linux machine, the result would obviously be wrong. .IP This value is available in the Nix language as \fB\f(CRbuiltins.currentSystem\fR\fR. .IP \fBDefault:\fR \f(CRx86_64-linux\fR .IP "\(bu" 3 \fB\f(CRsystem-features\fR\fR .IP A set of system “features” supported by this machine, e.g. \f(CRkvm\fR. Derivations can express a dependency on such features through the derivation attribute \f(CRrequiredSystemFeatures\fR. For example, the attribute .IP requiredSystemFeatures = [ \(lqkvm\(rq ]; .IP ensures that the derivation can only be built on a machine with the \f(CRkvm\fR feature. .IP This setting by default includes \f(CRkvm\fR if \f(CR/dev/kvm\fR is accessible, and the pseudo-features \f(CRnixos-test\fR, \f(CRbenchmark\fR and \f(CRbig-parallel\fR that are used in Nixpkgs to route builds to specific machines. .IP \fBDefault:\fR \fImachine-specific\fR .IP "\(bu" 3 \fB\f(CRtarball-ttl\fR\fR .IP The number of seconds a downloaded tarball is considered fresh. If the cached tarball is stale, Nix will check whether it is still up to date using the ETag header. Nix will download a new version if the ETag header is unsupported, or the cached ETag doesn\(cqt match. .IP Setting the TTL to \f(CR0\fR forces Nix to always check if the tarball is up to date. .IP Nix caches tarballs in \f(CR$XDG_CACHE_HOME/nix/tarballs\fR. .IP Files fetched via \f(CRNIX_PATH\fR, \f(CRfetchGit\fR, \f(CRfetchMercurial\fR, \f(CRfetchTarball\fR, and \f(CRfetchurl\fR respect this TTL. .IP \fBDefault:\fR \f(CR3600\fR .IP "\(bu" 3 \fB\f(CRtimeout\fR\fR .IP This option defines the maximum number of seconds that a builder can run. This is useful (for instance in an automated build system) to catch builds that are stuck in an infinite loop but keep writing to their standard output or standard error. It can be overridden using the \f(CR--timeout\fR command line switch. .IP The value \f(CR0\fR means that there is no timeout. This is also the default. .IP \fBDefault:\fR \f(CR0\fR .IP \fBDeprecated alias:\fR \f(CRbuild-timeout\fR .IP "\(bu" 3 \fB\f(CRtrace-function-calls\fR\fR .IP If set to \f(CRtrue\fR, the Nix evaluator will trace every function call. Nix will print a log message at the \(lqvomit\(rq level for every function entrance and function exit. .IP function-trace entered undefined position at 1565795816999559622 function-trace exited undefined position at 1565795816999581277 function-trace entered /nix/store/\[u2026]/example.nix:226:41 at 1565795253249935150 function-trace exited /nix/store/\[u2026]/example.nix:226:41 at 1565795253249941684 .IP The \f(CRundefined position\fR means the function call is a builtin. .IP Use the \f(CRcontrib/stack-collapse.py\fR script distributed with the Nix source code to convert the trace logs in to a format suitable for \f(CRflamegraph.pl\fR. .IP \fBDefault:\fR \f(CRfalse\fR .IP "\(bu" 3 \fB\f(CRtrace-verbose\fR\fR .IP Whether \f(CRbuiltins.traceVerbose\fR should trace its first argument when evaluated. .IP \fBDefault:\fR \f(CRfalse\fR .IP "\(bu" 3 \fB\f(CRtrusted-public-keys\fR\fR .IP A whitespace-separated list of public keys. .IP At least one of the following condition must be met for Nix to accept copying a store object from another Nix store (such as a substituter): .RS .IP "\(bu" 3 the store object has been signed using a key in the trusted keys list .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 the \fB\f(CRrequire-sigs\fR\fR option has been set to \f(CRfalse\fR .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 3 the store object is \fBoutput-addressed\fR .RE .IP \fBDefault:\fR \f(CRcache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=\fR .IP \fBDeprecated alias:\fR \f(CRbinary-cache-public-keys\fR .IP "\(bu" 3 \fB\f(CRtrusted-substituters\fR\fR .IP A list of \fBNix store URLs\fR, separated by whitespace. These are not used by default, but users of the Nix daemon can enable them by specifying \fB\f(CRsubstituters\fR\fR. .IP Unprivileged users (those set in only \fB\f(CRallowed-users\fR\fR but not \fB\f(CRtrusted-users\fR\fR) can pass as \f(CRsubstituters\fR only those URLs listed in \f(CRtrusted-substituters\fR. .IP \fBDefault:\fR \fIempty\fR .IP \fBDeprecated alias:\fR \f(CRtrusted-binary-caches\fR .IP "\(bu" 3 \fB\f(CRtrusted-users\fR\fR .IP A list of user names, separated by whitespace. These users will have additional rights when connecting to the Nix daemon, such as the ability to specify additional \fBsubstituters\fR, or to import unsigned \fBNARs\fR. .IP You can also specify groups by prefixing names with \f(CR@\fR. For instance, \f(CR@wheel\fR means all users in the \f(CRwheel\fR group. .RS .IP \fBWarning\fR .IP Adding a user to \f(CRtrusted-users\fR is essentially equivalent to giving that user root access to the system. For example, the user can access or replace store path contents that are critical for system security. .RE .IP \fBDefault:\fR \f(CRroot\fR .IP "\(bu" 3 \fB\f(CRuse-case-hack\fR\fR .IP Whether to enable a Darwin-specific hack for dealing with file name collisions. .IP \fBDefault:\fR \f(CRfalse\fR .IP "\(bu" 3 \fB\f(CRuse-cgroups\fR\fR .IP Whether to execute builds inside cgroups. This is only supported on Linux. .IP Cgroups are required and enabled automatically for derivations that require the \f(CRuid-range\fR system feature. .IP \fBDefault:\fR \f(CRfalse\fR .IP "\(bu" 3 \fB\f(CRuse-registries\fR\fR .IP Whether to use flake registries to resolve flake references. .RS .IP \fBWarning\fR This setting is part of an \fBexperimental feature\fR. .RE .IP To change this setting, you need to make sure the corresponding experimental feature, \fB\f(CRflakes\fR\fR, is enabled. For example, include the following in \fB\f(CRnix.conf\fR\fR: .LP .EX extra-experimental-features = flakes use-registries = ... .EE .IP \fBDefault:\fR \f(CRtrue\fR .IP "\(bu" 3 \fB\f(CRuse-sqlite-wal\fR\fR .IP Whether SQLite should use WAL mode. .IP \fBDefault:\fR \f(CRtrue\fR .IP "\(bu" 3 \fB\f(CRuse-xdg-base-directories\fR\fR .IP If set to \f(CRtrue\fR, Nix will conform to the \fBXDG Base Directory Specification\fR for files in \f(CR$HOME\fR. The environment variables used to implement this are documented in the \fBEnvironment Variables section\fR. .RS .IP \fBWarning\fR This changes the location of some well-known symlinks that Nix creates, which might break tools that rely on the old, non-XDG-conformant locations. .RE .IP In particular, the following locations change: .TS tab(|) expand allbox; lb lb l l. T{ Old T}|T{ New T} T{ \f(CR\(ti/.nix-profile\fR T}|T{ \f(CR$XDG_STATE_HOME/nix/profile\fR T} T{ \f(CR\(ti/.nix-defexpr\fR T}|T{ \f(CR$XDG_STATE_HOME/nix/defexpr\fR T} T{ \f(CR\(ti/.nix-channels\fR T}|T{ \f(CR$XDG_STATE_HOME/nix/channels\fR T} .TE .IP If you already have Nix installed and are using \fBprofiles\fR or \fBchannels\fR, you should migrate manually when you enable this option. If \f(CR$XDG_STATE_HOME\fR is not set, use \f(CR$HOME/.local/state/nix\fR instead of \f(CR$XDG_STATE_HOME/nix\fR. This can be achieved with the following shell commands: .LP .EX nix_state_home=${XDG_STATE_HOME-$HOME/.local/state}/nix mkdir -p $nix_state_home mv $HOME/.nix-profile $nix_state_home/profile mv $HOME/.nix-defexpr $nix_state_home/defexpr mv $HOME/.nix-channels $nix_state_home/channels .EE .IP \fBDefault:\fR \f(CRfalse\fR .IP "\(bu" 3 \fB\f(CRuser-agent-suffix\fR\fR .IP String appended to the user agent in HTTP requests. .IP \fBDefault:\fR \fIempty\fR .IP "\(bu" 3 \fB\f(CRwarn-dirty\fR\fR .IP Whether to warn about dirty Git/Mercurial trees. .IP \fBDefault:\fR \f(CRtrue\fR