mirror of
https://github.com/NixOS/nix
synced 2025-07-06 21:41:48 +02:00
unsafeDiscardReferences
Adds a new boolean structured attribute `outputChecks.<output>.unsafeDiscardReferences` which disables scanning an output for runtime references. __structuredAttrs = true; outputChecks.out.unsafeDiscardReferences = true; This is useful when creating filesystem images containing their own embedded Nix store: they are self-contained blobs of data with no runtime dependencies. Setting this attribute requires the experimental feature `discard-references` to be enabled.
This commit is contained in:
parent
15341334b5
commit
15f7fa59be
7 changed files with 58 additions and 7 deletions
|
@ -207,13 +207,13 @@ Derivations can declare some infrequently used optional attributes.
|
|||
the hash in either hexadecimal or base-32 notation. (See the
|
||||
[`nix-hash` command](../command-ref/nix-hash.md) for information
|
||||
about converting to and from base-32 notation.)
|
||||
|
||||
|
||||
- [`__contentAddressed`]{#adv-attr-__contentAddressed}
|
||||
If this **experimental** attribute is set to true, then the derivation
|
||||
outputs will be stored in a content-addressed location rather than the
|
||||
traditional input-addressed one.
|
||||
This only has an effect if the `ca-derivation` experimental feature is enabled.
|
||||
|
||||
This only has an effect if the `ca-derivations` experimental feature is enabled.
|
||||
|
||||
Setting this attribute also requires setting `outputHashMode` and `outputHashAlgo` like for *fixed-output derivations* (see above).
|
||||
|
||||
- [`passAsFile`]{#adv-attr-passAsFile}\
|
||||
|
|
|
@ -21,3 +21,15 @@
|
|||
* Error traces have been reworked to provide detailed explanations and more
|
||||
accurate error locations. A short excerpt of the trace is now shown by
|
||||
default when an error occurs.
|
||||
|
||||
* In derivations that use structured attributes, you can now use `unsafeDiscardReferences`
|
||||
to disable scanning a given output for runtime dependencies:
|
||||
```nix
|
||||
__structuredAttrs = true;
|
||||
outputChecks.out.unsafeDiscardReferences = true;
|
||||
```
|
||||
This is useful e.g. when generating self-contained filesystem images with
|
||||
their own embedded Nix store: hashes found inside such an image refer
|
||||
to the embedded store and not to the host's Nix store.
|
||||
|
||||
This requires the `discard-references` experimental feature.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue