62 If a store path is queried from a [substituter](#conf-substituters) but was not found, a negative lookup is cached in the local disk cache database for the specified duration.
216 The system type of the current Nix installation.
217 Nix only builds a given [store derivation](@docroot@/glossary.md#gloss-store-derivation) locally when its `system` attribute equals any of the values specified here or in [`extra-platforms`](#conf-extra-platforms).
218
219 The default value is set when Nix itself is compiled for the system it will run on.
220 The following system types are widely used, as Nix is actively supported on these platforms:
221
222 - `x86_64-linux`
223 - `x86_64-darwin` (only via Rosetta 2)
224 - `i686-linux`
225 - `aarch64-linux`
226 - `aarch64-darwin`
227 - `armv6l-linux`
228 - `armv7l-linux`
229
230 In general, you do not have to modify this setting.
231 While you can force Nix to run a Darwin-specific `builder` executable on a Linux machine, the result would obviously be wrong.
232
233 This value is available in the Nix language as
247 At least one of the following condition must be met
248 for Nix to accept copying a store object from another
249 Nix store (such as a [substituter](#conf-substituters)):
250
251 - the store object has been signed using a key in the trusted keys list
252 - the [`require-sigs`](#conf-require-sigs) option has been set to `false`
253 - the store URL is configured with `trusted=true`
254 - the store object is [content-addressed](@docroot@/glossary.md#gloss-content-addressed-store-object)
255 )",
256 {"binary-cache-public-keys"}};
257
258 Setting<Strings> secretKeyFiles{
259this,
260 {},
261"secret-key-files",
262 R"(
263 A whitespace-separated list of files containing secret (private)
264 keys. These are used to sign locally-built paths. They can be
265 generated using `nix-store --generate-binary-cache-key`. The
266 corresponding public key can be distributed to other users, who
267 can add it to `trusted-public-keys` in their `nix.conf`.
268 )"};
269
270 Setting<bool> requireSigs{
271this,
272true,
273"require-sigs",
274 R"(
275 If set to `true` (the default), any non-content-addressed path added
276 or copied to the Nix store (e.g. when substituting from a binary
277 cache) must have a signature by a trusted key. A trusted key is one
278 listed in `trusted-public-keys`, or a public key counterpart to a
279 private key stored in a file listed in `secret-key-files`.
280
281 Set to `false` to disable signature checking and trust all
282 non-content-addressed paths unconditionally.
283
284 (Content-addressed paths are inherently trustworthy and thus
285 unaffected by this configuration option.)
286 )"};
287
288 Setting<StringSet> extraPlatforms{
289this,
290 getDefaultExtraPlatforms(),
291"extra-platforms",
292 R"(
293 System types of executables that can be run on this machine.
294
295 Nix only builds a given [store derivation](@docroot@/glossary.md#gloss-store-derivation) locally when its `system` attribute equals any of the values specified here or in the [`system` option](#conf-system).
296
297 Setting this can be useful to build derivations locally on compatible machines:
298 - `i686-linux` executables can be run on `x86_64-linux` machines (set by default)
299 - `x86_64-darwin` executables can be run on macOS `aarch64-darwin` with Rosetta 2 (set by default where applicable)
300 - `armv6` and `armv5tel` executables can be run on `armv7`
301 - some `aarch64` machines can also natively run 32-bit ARM code
302 - `qemu-user` may be used to support non-native platforms (though this
303 may be slow and buggy)
304
305 Build systems 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.
306 You should design your derivation's `builder` accordingly and cross-check the results when using this option against natively-built versions of your derivation.
307 )",
308 {},
309// Don't document the machine-specific default value
310false};
311
312 Setting<StringSet> systemFeatures{
313this,
314 getDefaultSystemFeatures(),
315"system-features",
316 R"(
317 A set of system “features” supported by this machine.
318
319 This complements the [`system`](#conf-system) and [`extra-platforms`](#conf-extra-platforms) configuration options and the corresponding [`system`](@docroot@/language/derivations.md#attr-system) attribute on derivations.
320
321 A derivation can require system features in the [`requiredSystemFeatures` attribute](@docroot@/language/advanced-attributes.md#adv-attr-requiredSystemFeatures), and the machine to build the derivation must have them.
322
323 System features are user-defined, but Nix sets the following defaults:
324
325 - `apple-virt`
326
327 Included on Darwin if virtualization is available.
328
329 - `kvm`
330
331 Included on Linux if `/dev/kvm` is accessible.
332
333 - `nixos-test`, `benchmark`, `big-parallel`
334
335 These historical pseudo-features are always enabled for backwards compatibility, as they are used in Nixpkgs to route Hydra builds to specific machines.
336
337 - `ca-derivations`
338
339 Included by default if the [`ca-derivations` experimental feature](@docroot@/development/experimental-features.md#xp-feature-ca-derivations) is enabled.
340
341 This system feature is implicitly required by derivations with the [`__contentAddressed` attribute](@docroot@/language/advanced-attributes.md#adv-attr-__contentAddressed).
342
343 - `recursive-nix`
344
345 Included by default if the [`recursive-nix` experimental feature](@docroot@/development/experimental-features.md#xp-feature-recursive-nix) is enabled.
346
347 - `uid-range`
348
349 On Linux, Nix can run builds in a user namespace where they run as root (UID 0) and have 65,536 UIDs available.
350 This is primarily useful for running containers such as `systemd-nspawn` inside a Nix build. For an example, see [`tests/systemd-nspawn/nix`][nspawn].
368 A list of [Nix store URLs](@docroot@/store/types/index.md#store-url-format), separated by whitespace.
369 These are not used by default, but users of the Nix daemon can enable them by specifying [`substituters`](#conf-substituters).
370
371 Unprivileged users (those set in only [`allowed-users`](#conf-allowed-users) but not [`trusted-users`](#conf-trusted-users)) can pass as `substituters` only those URLs listed in `trusted-substituters`.
372 )",
373 {"trusted-binary-caches"}};
374
375// move it out in the 2nd pass
376 Setting<bool> printMissing{
377this, true, "print-missing", "Whether to print what paths need to be built or downloaded."};
378
379 Setting<bool> useXDGBaseDirectories{
380this,
381false,
382"use-xdg-base-directories",
383 R"(
384 If set to `true`, Nix conforms to the [XDG Base Directory Specification] for files in `$HOME`.
385 The environment variables used to implement this are documented in the [Environment Variables section](@docroot@/command-ref/env-common.md).
386
387 [XDG Base Directory Specification]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
388
389 > **Warning**
390 > 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.
391
392 In particular, the following locations change:
400 If you already have Nix installed and are using [profiles](@docroot@/package-management/profiles.md) or [channels](@docroot@/command-ref/nix-channel.md), you should migrate manually when you enable this option.
401 If `$XDG_STATE_HOME` is not set, use `$HOME/.local/state/nix` instead of `$XDG_STATE_HOME/nix`.
402 This can be achieved with the following shell commands: