Store Object Info v3
- 1. Property
Store Object Info - 2. Property
Store Object Info with Impure Fields- 2.1. Property
version - 2.2. Property
path - 2.3. Property
narHash - 2.4. Property
narSize - 2.5. Property
references - 2.6. Property
ca - 2.7. Property
storeDir - 2.8. Property
deriver - 2.9. Property
registrationTime - 2.10. Property
ultimate - 2.11. Property
signatures - 2.12. Property
closureSize - 2.13. Property
provenance- 2.13.1. Property
item 0 - 2.13.2. Property
Provenance- 2.13.2.1. Property
Build - 2.13.2.2. Property
Copied - 2.13.2.3. Property
Derivation - 2.13.2.4. Property
Flake - 2.13.2.5. Property
Subpath - 2.13.2.6. Property
Tree - 2.13.2.7. Property
Fetchurl - 2.13.2.8. Property
Unknown
- 2.13.2.1. Property
- 2.13.1. Property
- 2.1. Property
- 3. Property
Store Object Info with Impure fields and NAR Info- 3.1. Property
version - 3.2. Property
path - 3.3. Property
narHash - 3.4. Property
narSize - 3.5. Property
references - 3.6. Property
ca - 3.7. Property
storeDir - 3.8. Property
deriver - 3.9. Property
registrationTime - 3.10. Property
ultimate - 3.11. Property
signatures - 3.12. Property
closureSize - 3.13. Property
url - 3.14. Property
compression - 3.15. Property
downloadHash - 3.16. Property
downloadSize - 3.17. Property
closureDownloadSize - 3.18. Property
provenance
- 3.1. Property
Title: Store Object Info v3
| Type | combining |
| Required | No |
| Additional properties | Any type allowed |
Description: Information about a store object.
This schema describes the JSON representation of store object metadata as returned by commands like nix path-info --json.
Field Categories
Store object information can come in a few different variations.
Firstly, “impure” fields, which contain non-intrinsic information about the store object, may or may not be included.
Second, binary cache stores have extra non-intrinsic infomation about the store objects they contain.
Thirdly, nix path-info --json --closure-size can compute some extra information about not just the single store object in question, but the store object and its closure.
The impure and NAR fields are grouped into separate variants below. See their descriptions for additional information. The closure fields however as just included as optional fields, to avoid a combinatorial explosion of variants.
| One of(Option) |
|---|
| Store Object Info |
| Store Object Info with Impure Fields |
| Store Object Info with Impure fields and NAR Info |
1. Property Store Object Info
Title: Store Object Info
| Type | object |
| Required | No |
| Additional properties | Not allowed |
| Defined in | #/$defs/base |
Description: Basic store object metadata containing only intrinsic properties. This is the minimal set of fields that describe what a store object contains.
| Property | Type | Pattern | Title/Description |
|---|---|---|---|
| + version | const | No | Format version (must be 3) |
| - path | string | No | Store Path |
| + narHash | string | No | NAR Hash |
| + narSize | integer | No | NAR Size |
| + references | array | No | References |
| + ca | Combination | No | Content Address |
| + storeDir | string | No | Store Directory |
1.1. Property version
Title: Format version (must be 3)
| Type | const |
| Required | Yes |
Description: Must be 3.
This is a guard that allows us to continue evolving this format.
Here is the rough version history:
-
Version 0:
.narinfoline-oriented format -
Version 1: Original JSON format, with ugly
"r:sha256"inherited from.narinfoformat. -
Version 2: Use structured JSON type for
ca -
Version 3: Use structured JSON type for
signatures
Specific value: 3
1.2. Property path
Title: Store Path
| Type | string |
| Required | No |
| Defined in | JSON format for StorePath |
Description: Store path to the given store object.
Note: This field may not be present in all contexts, such as when the path is used as the key and the the store object info the value in map.
| Restrictions | |
|---|---|
| Min length | 34 |
| Must match regular expression | ^[0123456789abcdfghijklmnpqrsvwxyz]{32}-.+$ Test |
1.3. Property narHash
Title: NAR Hash
| Type | string |
| Required | Yes |
| Defined in | JSON format for Hash |
Description: Hash of the file system object part of the store object when serialized as a Nix Archive.
Examples:
"sha256-ungWv48Bz+pBQUDeXa4iI7ADYaOWF3qctBD/YfIAFa0="
"sha512-IEqPxt2oLwoM7XvrjgikFlfBbvRosiioJ5vjMacDwzWW/RXBOxsH+aodO+pXeJygMa2Fx6cd1wNU7GMSOMo0RQ=="
| Restrictions | |
|---|---|
| Must match regular expression | ^(blake3|md5|sha1|sha256|sha512)-[A-Za-z0-9+/]+=*$ Test |
1.4. Property narSize
Title: NAR Size
| Type | integer |
| Required | Yes |
Description: Size of the file system object part of the store object when serialized as a Nix Archive.
| Restrictions | |
|---|---|
| Minimum | ≥ 0 |
1.5. Property references
Title: References
| Type | array |
| Required | Yes |
Description: An array of store paths, possibly including this one.
| Array restrictions | |
|---|---|
| Min items | N/A |
| Max items | N/A |
| Items unicity | False |
| Additional items | False |
| Tuple validation | See below |
| Each item of this array must be | Description |
|---|---|
| Store Path | A store path identifying a store object. … |
1.5.1. Store Path
Title: Store Path
| Type | string |
| Required | No |
| Same definition as | path |
Description: A store path identifying a store object.
This schema describes the JSON representation of store paths as used in various Nix JSON APIs.
Format
Store paths in JSON are represented as strings containing just the hash and name portion, without the store directory prefix.
For example: "g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo.drv"
(If the store dir is /nix/store, then this corresponds to the path /nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo.drv.)
Structure
The format follows this pattern: ${digest}-${name}
- hash: Digest rendered in Nix32 (20 hash bytes become 32 ASCII characters)
- name: The package name and optional version/suffix information
1.6. Property ca
Title: Content Address
| Type | combining |
| Required | Yes |
| Additional properties | Any type allowed |
Description: If the store object is content-addressed,
this is the content address of this store object’s file system object, used to compute its store path.
Otherwise (i.e. if it is input-addressed), this is null.
| One of(Option) |
|---|
| item 0 |
| Content Address |
1.6.1. Property item 0
| Type | const |
| Required | No |
Specific value: null
1.6.2. Property Content Address
Title: Content Address
| Type | object |
| Required | No |
| Additional properties | Not allowed |
| Defined in | JSON format for ContentAddress |
Description: This schema describes the JSON representation of Nix’s ContentAddress type, which conveys information about content-addressing store objects.
Note
For current methods of content addressing, this data type is a bit suspicious, because it is neither simply a content address of a file system object (the
methodis richer), nor simply a content address of a store object (thehashdoesn’t account for the references). It should thus only be used in contexts where the references are also known / otherwise made tamper-resistant.
| Property | Type | Pattern | Title/Description |
|---|---|---|---|
| + method | enum (of string) | No | Content-Addressing Method |
| + hash | string | No | Content Address |
1.6.2.1. Property method
Title: Content-Addressing Method
| Type | enum (of string) |
| Required | Yes |
| Defined in | JSON format for ContentAddress |
Description: A string representing the method of content addressing that is chosen.
Valid method strings are:
Must be one of:
- “flat”
- “nar”
- “text”
- “git”
1.6.2.2. Property hash
Title: Content Address
| Type | string |
| Required | Yes |
| Defined in | JSON format for Hash |
Description: This would be the content-address itself.
For all current methods, this is just a content address of the file system object of the store object, as described in the store chapter, and not of the store object as a whole. In particular, the references of the store object are not taken into account with this hash (and currently-supported methods).
Examples:
"sha256-ungWv48Bz+pBQUDeXa4iI7ADYaOWF3qctBD/YfIAFa0="
"sha512-IEqPxt2oLwoM7XvrjgikFlfBbvRosiioJ5vjMacDwzWW/RXBOxsH+aodO+pXeJygMa2Fx6cd1wNU7GMSOMo0RQ=="
| Restrictions | |
|---|---|
| Must match regular expression | ^(blake3|md5|sha1|sha256|sha512)-[A-Za-z0-9+/]+=*$ Test |
1.7. Property storeDir
Title: Store Directory
| Type | string |
| Required | Yes |
Description: The path to the store directory this store object belongs within (e.g. /nix/store).
2. Property Store Object Info with Impure Fields
Title: Store Object Info with Impure Fields
| Type | object |
| Required | No |
| Additional properties | Not allowed |
| Defined in | #/$defs/impure |
Description: Store object metadata including impure fields that are not intrinsic properties. In other words, the same store object in different stores could have different values for these impure fields.
| Property | Type | Pattern | Title/Description |
|---|---|---|---|
| + version | const | No | Format version (must be 3) |
| - path | string | No | Store Path |
| + narHash | string | No | NAR Hash |
| + narSize | integer | No | NAR Size |
| + references | array | No | References |
| + ca | object | No | Content Address |
| + storeDir | string | No | Store Directory |
| + deriver | Combination | No | Deriver |
| + registrationTime | integer or null | No | Registration Time |
| + ultimate | boolean | No | Ultimate |
| + signatures | array | No | Signatures |
| - closureSize | integer | No | Closure Size |
| - provenance | Combination | No | Provenance |
2.1. Property version
Title: Format version (must be 3)
| Type | const |
| Required | Yes |
| Defined in | #/$defs/base/properties/version |
Description: Must be 3.
This is a guard that allows us to continue evolving this format.
Here is the rough version history:
-
Version 0:
.narinfoline-oriented format -
Version 1: Original JSON format, with ugly
"r:sha256"inherited from.narinfoformat. -
Version 2: Use structured JSON type for
ca -
Version 3: Use structured JSON type for
signatures
Specific value: 3
2.2. Property path
Title: Store Path
| Type | string |
| Required | No |
| Defined in | #/$defs/base/properties/path |
Description: Store path to the given store object.
Note: This field may not be present in all contexts, such as when the path is used as the key and the the store object info the value in map.
| Restrictions | |
|---|---|
| Min length | 34 |
| Must match regular expression | ^[0123456789abcdfghijklmnpqrsvwxyz]{32}-.+$ Test |
2.3. Property narHash
Title: NAR Hash
| Type | string |
| Required | Yes |
| Defined in | #/$defs/base/properties/narHash |
Description: Hash of the file system object part of the store object when serialized as a Nix Archive.
Examples:
"sha256-ungWv48Bz+pBQUDeXa4iI7ADYaOWF3qctBD/YfIAFa0="
"sha512-IEqPxt2oLwoM7XvrjgikFlfBbvRosiioJ5vjMacDwzWW/RXBOxsH+aodO+pXeJygMa2Fx6cd1wNU7GMSOMo0RQ=="
| Restrictions | |
|---|---|
| Must match regular expression | ^(blake3|md5|sha1|sha256|sha512)-[A-Za-z0-9+/]+=*$ Test |
2.4. Property narSize
Title: NAR Size
| Type | integer |
| Required | Yes |
| Defined in | #/$defs/base/properties/narSize |
Description: Size of the file system object part of the store object when serialized as a Nix Archive.
| Restrictions | |
|---|---|
| Minimum | ≥ 0 |
2.5. Property references
Title: References
| Type | array |
| Required | Yes |
| Defined in | #/$defs/base/properties/references |
Description: An array of store paths, possibly including this one.
| Array restrictions | |
|---|---|
| Min items | N/A |
| Max items | N/A |
| Items unicity | False |
| Additional items | False |
| Tuple validation | See below |
| Each item of this array must be | Description |
|---|---|
| Store Path | A store path identifying a store object. … |
2.5.1. Store Path
Title: Store Path
| Type | string |
| Required | No |
| Same definition as | path |
Description: A store path identifying a store object.
This schema describes the JSON representation of store paths as used in various Nix JSON APIs.
Format
Store paths in JSON are represented as strings containing just the hash and name portion, without the store directory prefix.
For example: "g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo.drv"
(If the store dir is /nix/store, then this corresponds to the path /nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo.drv.)
Structure
The format follows this pattern: ${digest}-${name}
- hash: Digest rendered in Nix32 (20 hash bytes become 32 ASCII characters)
- name: The package name and optional version/suffix information
2.6. Property ca
Title: Content Address
| Type | combining |
| Required | Yes |
| Additional properties | Any type allowed |
| Defined in | #/$defs/base/properties/ca |
Description: If the store object is content-addressed,
this is the content address of this store object’s file system object, used to compute its store path.
Otherwise (i.e. if it is input-addressed), this is null.
| One of(Option) |
|---|
| item 0 |
| Content Address |
2.6.1. Property item 0
| Type | const |
| Required | No |
Specific value: null
2.6.2. Property Content Address
Title: Content Address
| Type | object |
| Required | No |
| Additional properties | Not allowed |
| Same definition as | Content Address |
Description: This schema describes the JSON representation of Nix’s ContentAddress type, which conveys information about content-addressing store objects.
Note
For current methods of content addressing, this data type is a bit suspicious, because it is neither simply a content address of a file system object (the
methodis richer), nor simply a content address of a store object (thehashdoesn’t account for the references). It should thus only be used in contexts where the references are also known / otherwise made tamper-resistant.
2.7. Property storeDir
Title: Store Directory
| Type | string |
| Required | Yes |
| Defined in | #/$defs/base/properties/storeDir |
Description: The path to the store directory this store object belongs within (e.g. /nix/store).
2.8. Property deriver
Title: Deriver
| Type | combining |
| Required | Yes |
| Additional properties | Any type allowed |
Description: If known, the path to the store derivation from which this store object was produced.
Otherwise null.
This is an “impure” field that may not be included in certain contexts.
| One of(Option) |
|---|
| Store Path |
| item 1 |
2.8.1. Property Store Path
Title: Store Path
| Type | string |
| Required | No |
| Same definition as | path |
Description: A store path identifying a store object.
This schema describes the JSON representation of store paths as used in various Nix JSON APIs.
Format
Store paths in JSON are represented as strings containing just the hash and name portion, without the store directory prefix.
For example: "g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo.drv"
(If the store dir is /nix/store, then this corresponds to the path /nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo.drv.)
Structure
The format follows this pattern: ${digest}-${name}
- hash: Digest rendered in Nix32 (20 hash bytes become 32 ASCII characters)
- name: The package name and optional version/suffix information
2.8.2. Property item 1
| Type | null |
| Required | No |
2.9. Property registrationTime
Title: Registration Time
| Type | integer or null |
| Required | Yes |
Description: If known, when this derivation was added to the store (Unix timestamp).
Otherwise null.
This is an “impure” field that may not be included in certain contexts.
2.10. Property ultimate
Title: Ultimate
| Type | boolean |
| Required | Yes |
Description: Whether this store object is trusted because we built it ourselves, rather than substituted a build product from elsewhere.
This is an “impure” field that may not be included in certain contexts.
2.11. Property signatures
Title: Signatures
| Type | array |
| Required | Yes |
Description: Signatures claiming that this store object is what it claims to be. Not relevant for content-addressed store objects, but useful for input-addressed store objects.
This is an “impure” field that may not be included in certain contexts.
| Array restrictions | |
|---|---|
| Min items | N/A |
| Max items | N/A |
| Items unicity | False |
| Additional items | False |
| Tuple validation | See below |
| Each item of this array must be | Description |
|---|---|
| Signature | A cryptographic signature along with the name of the key that produced it. … |
2.11.1. Signature
Title: Signature
| Type | object |
| Required | No |
| Additional properties | Any type allowed |
| Defined in | ./signature-v2.yaml |
Description: A cryptographic signature along with the name of the key that produced it.
This schema describes the JSON representation of signatures as used in various Nix JSON APIs.
Version History
-
Version 1: Colon-separated string in the format
<key-name>:<signature-in-Base64> -
Version 2: Structured object with
keyNameandsigfields
2.11.1.1. Property keyName
Title: Key Name
| Type | string |
| Required | Yes |
Description: The name of the key used to produce this signature
2.11.1.2. Property sig
Title: Signature Data
| Type | string |
| Required | Yes |
Description: The raw signature bytes, Base64-encoded
2.12. Property closureSize
Title: Closure Size
| Type | integer |
| Required | No |
Description: The total size of this store object and every other object in its closure.
This field is not stored at all, but computed by traversing the other fields across all the store objects in a closure.
| Restrictions | |
|---|---|
| Minimum | ≥ 0 |
2.13. Property provenance
Title: Provenance
| Type | combining |
| Required | No |
| Additional properties | Any type allowed |
Description: Provenance information about the store object, or null if not available.
| One of(Option) |
|---|
| item 0 |
| Provenance |
2.13.1. Property item 0
| Type | null |
| Required | No |
2.13.2. Property Provenance
Title: Provenance
| Type | combining |
| Required | No |
| Additional properties | Any type allowed |
| Defined in | ./provenance-v1.yaml |
Description: > Warning
This JSON format is currently experimental and subject to change.
Provenance describes where a store object came from, such as the derivation that built it, the flake output that produced that derivation, or the source tree that it was fetched from.
It appears in the provenance field of store object info, as shown by e.g. nix path-info --json.
A provenance record is a JSON object with a type field that determines what other fields are present.
Most types have a next field that contains the provenance of the thing from which this one was derived (or null if that isn’t known).
Thus, provenance forms a chain, going from the store object itself back to its ultimate origin.
For example, a store object substituted from a binary cache might have copied provenance, whose next is build provenance, whose next is derivation provenance, and so on.
Future versions of Nix may add new provenance types, and new fields to existing types.
Consumers should therefore accept provenance records with a type that they don’t recognise, and ignore fields that they don’t recognise.
Nix itself preserves records of unknown types unchanged.
2.13.2.1. Property Build
Title: Build
| Type | object |
| Required | No |
| Additional properties | Any type allowed |
| Defined in | #/$defs/build |
Description: The store object is an output of a derivation that was built locally or on a remote builder.
| Property | Type | Pattern | Title/Description |
|---|---|---|---|
| + type | enum (of string) | No | - |
| + drv | string | No | Derivation |
| + output | string | No | Output Name |
| - buildHost | Combination | No | Build Host |
| + system | string | No | System |
| - tags | object | No | Tags |
| - next | object | No | Next |
2.13.2.1.1. Property type
| Type | enum (of string) |
| Required | Yes |
Must be one of:
- “build”
2.13.2.1.2. Property drv
Title: Derivation
| Type | string |
| Required | Yes |
| Defined in | JSON format for StorePath |
Description: The store derivation that was built.
| Restrictions | |
|---|---|
| Min length | 34 |
| Must match regular expression | ^[0123456789abcdfghijklmnpqrsvwxyz]{32}-.+$ Test |
2.13.2.1.3. Property output
Title: Output Name
| Type | string |
| Required | Yes |
Description: The name of the derivation output that corresponds to this store object, e.g. out.
2.13.2.1.4. Property buildHost
Title: Build Host
| Type | combining |
| Required | No |
| Additional properties | Any type allowed |
Description: The hostname of the machine on which the derivation was built, or null if not known.
2.13.2.1.4.1. Property item 0
| Type | string |
| Required | No |
2.13.2.1.4.2. Property item 1
| Type | null |
| Required | No |
2.13.2.1.5. Property system
Title: System
| Type | string |
| Required | Yes |
Description: The system type of the derivation, e.g. x86_64-linux.
2.13.2.1.6. Property tags
Title: Tags
| Type | object |
| Required | No |
| Additional properties | Not allowed |
Description: User-defined key/value pairs from the build-provenance-tags setting on the build host, e.g. a CI job URL.
| Property | Type | Pattern | Title/Description |
|---|---|---|---|
| - ^[A-Za-z_][A-Za-z0-9_+-]*$ | string | Yes | - |
2.13.2.1.6.1. Pattern Property ^[A-Za-z_][A-Za-z0-9_+\-]*$
All properties whose name matches the regular expression
^[A-Za-z_][A-Za-z0-9_+\-]*$(Test) must respect the following conditions
| Type | string |
| Required | No |
2.13.2.1.7. Property next
Title: Next
| Type | combining |
| Required | No |
| Additional properties | Any type allowed |
| Defined in | #/$defs/next |
Description: The provenance of the derivation, typically of type derivation.
| One of(Option) |
|---|
| item 0 |
| Provenance |
2.13.2.1.7.1. Property item 0
| Type | null |
| Required | No |
2.13.2.1.7.2. Property Provenance
Title: Provenance
| Type | combining |
| Required | No |
| Additional properties | Any type allowed |
| Same definition as | Provenance |
Description: > Warning
This JSON format is currently experimental and subject to change.
Provenance describes where a store object came from, such as the derivation that built it, the flake output that produced that derivation, or the source tree that it was fetched from.
It appears in the provenance field of store object info, as shown by e.g. nix path-info --json.
A provenance record is a JSON object with a type field that determines what other fields are present.
Most types have a next field that contains the provenance of the thing from which this one was derived (or null if that isn’t known).
Thus, provenance forms a chain, going from the store object itself back to its ultimate origin.
For example, a store object substituted from a binary cache might have copied provenance, whose next is build provenance, whose next is derivation provenance, and so on.
Future versions of Nix may add new provenance types, and new fields to existing types.
Consumers should therefore accept provenance records with a type that they don’t recognise, and ignore fields that they don’t recognise.
Nix itself preserves records of unknown types unchanged.
2.13.2.2. Property Copied
Title: Copied
| Type | object |
| Required | No |
| Additional properties | Any type allowed |
| Defined in | #/$defs/copied |
Description: The store object was copied from another store, typically substituted from a binary cache.
| Property | Type | Pattern | Title/Description |
|---|---|---|---|
| + type | enum (of string) | No | - |
| + from | string | No | From |
| - next | object | No | Next |
2.13.2.2.1. Property type
| Type | enum (of string) |
| Required | Yes |
Must be one of:
- “copied”
2.13.2.2.2. Property from
Title: From
| Type | string |
| Required | Yes |
Description: The URL of the store from which the store object was copied.
2.13.2.2.3. Property next
Title: Next
| Type | combining |
| Required | No |
| Additional properties | Any type allowed |
| Same definition as | next |
Description: The provenance of the store object in the store from which it was copied.
2.13.2.3. Property Derivation
Title: Derivation
| Type | object |
| Required | No |
| Additional properties | Any type allowed |
| Defined in | #/$defs/derivation |
Description: The store object is a store derivation that was instantiated by builtins.derivationWithMeta.
| Property | Type | Pattern | Title/Description |
|---|---|---|---|
| + type | enum (of string) | No | - |
| + meta | object | No | Metadata |
| - next | object | No | Next |
2.13.2.3.1. Property type
| Type | enum (of string) |
| Required | Yes |
Must be one of:
- “derivation”
2.13.2.3.2. Property meta
Title: Metadata
| Type | object |
| Required | Yes |
| Additional properties | Any type allowed |
Description: The value of the __meta attribute passed to derivationWithMeta, converted to JSON.
2.13.2.3.3. Property next
Title: Next
| Type | combining |
| Required | No |
| Additional properties | Any type allowed |
| Same definition as | next |
Description: The provenance of the Nix expression that instantiated the derivation, typically of type flake.
2.13.2.4. Property Flake
Title: Flake
| Type | object |
| Required | No |
| Additional properties | Any type allowed |
| Defined in | #/$defs/flake |
Description: The thing was produced by evaluating a flake output.
| Property | Type | Pattern | Title/Description |
|---|---|---|---|
| + type | enum (of string) | No | - |
| + flakeOutput | string | No | Flake Output |
| - pure | boolean | No | Pure |
| - next | object | No | Next |
2.13.2.4.1. Property type
| Type | enum (of string) |
| Required | Yes |
Must be one of:
- “flake”
2.13.2.4.2. Property flakeOutput
Title: Flake Output
| Type | string |
| Required | Yes |
Description: The attribute path of the flake output that was evaluated, e.g. packages.x86_64-linux.default.
2.13.2.4.3. Property pure
Title: Pure
| Type | boolean |
| Required | No |
Description: Whether the flake output was evaluated in pure evaluation mode.
Defaults to true if absent.
2.13.2.4.4. Property next
Title: Next
| Type | combining |
| Required | No |
| Additional properties | Any type allowed |
| Same definition as | next |
Description: The provenance of the flake’s flake.nix file, typically of type subpath.
2.13.2.5. Property Subpath
Title: Subpath
| Type | object |
| Required | No |
| Additional properties | Any type allowed |
| Defined in | #/$defs/subpath |
Description: The thing is a file or directory inside another source tree.
| Property | Type | Pattern | Title/Description |
|---|---|---|---|
| + type | enum (of string) | No | - |
| + subpath | string | No | Subpath |
| - next | object | No | Next |
2.13.2.5.1. Property type
| Type | enum (of string) |
| Required | Yes |
Must be one of:
- “subpath”
2.13.2.5.2. Property subpath
Title: Subpath
| Type | string |
| Required | Yes |
Description: The absolute path of the file or directory within the source tree, e.g. /flake.nix.
2.13.2.5.3. Property next
Title: Next
| Type | combining |
| Required | No |
| Additional properties | Any type allowed |
| Same definition as | next |
Description: The provenance of the source tree, typically of type tree.
2.13.2.6. Property Tree
Title: Tree
| Type | object |
| Required | No |
| Additional properties | Any type allowed |
| Defined in | #/$defs/tree |
Description: The thing is a source tree fetched by a fetcher, e.g. a flake input.
2.13.2.6.1. Property type
| Type | enum (of string) |
| Required | Yes |
Must be one of:
- “tree”
2.13.2.6.2. Property attrs
Title: Attributes
| Type | object |
| Required | Yes |
| Additional properties | Each additional property must conform to the schema |
Description: The attributes of the locked input, as accepted by builtins.fetchTree, except narHash.
2.13.2.6.2.1. Property additionalProperties
| Type | string, integer or boolean |
| Required | No |
2.13.2.7. Property Fetchurl
Title: Fetchurl
| Type | object |
| Required | No |
| Additional properties | Any type allowed |
| Defined in | #/$defs/fetchurl |
Description: The store object was downloaded from a URL, e.g. by builtins.fetchurl.
2.13.2.7.1. Property type
| Type | enum (of string) |
| Required | Yes |
Must be one of:
- “fetchurl”
2.13.2.7.2. Property url
Title: URL
| Type | string |
| Required | Yes |
Description: The URL from which the store object was downloaded, with any credentials removed.
2.13.2.8. Property Unknown
Title: Unknown
| Type | object |
| Required | No |
| Additional properties | Any type allowed |
| Defined in | #/$defs/unknown |
Description: A provenance type not known to this version of Nix.
| Property | Type | Pattern | Title/Description |
|---|---|---|---|
| + type | Combination | No | - |
2.13.2.8.1. Property type
| Type | combining |
| Required | Yes |
2.13.2.8.1.1. Must not be
| Type | enum (of string) |
| Required | No |
Must be one of:
- “build”
- “copied”
- “derivation”
- “flake”
- “subpath”
- “tree”
- “fetchurl”
3. Property Store Object Info with Impure fields and NAR Info
Title: Store Object Info with Impure fields and NAR Info
| Type | object |
| Required | No |
| Additional properties | Not allowed |
| Defined in | #/$defs/narInfo |
Description: The store object info in the “binary cache” family of Nix store type contain extra information pertaining to downloads of the store object in question.
(This store info is called “NAR info”, since the downloads take the form of [Nix Archives](../../store/file-system-object/content-address.md#serial-nix-archive, and the metadata is served in a file with a .narinfo extension.)
This download information, being specific to how the store object happens to be stored and transferred, is also considered to be non-intrinsic / impure.
| Property | Type | Pattern | Title/Description |
|---|---|---|---|
| + version | const | No | Format version (must be 3) |
| - path | string | No | Store Path |
| + narHash | string | No | NAR Hash |
| + narSize | integer | No | NAR Size |
| + references | array | No | References |
| + ca | object | No | Content Address |
| + storeDir | string | No | Store Directory |
| + deriver | object | No | Deriver |
| + registrationTime | integer or null | No | Registration Time |
| + ultimate | boolean | No | Ultimate |
| + signatures | array | No | Signatures |
| - closureSize | integer | No | Closure Size |
| + url | string | No | URL |
| + compression | string | No | Compression |
| + downloadHash | string | No | Download Hash |
| + downloadSize | integer | No | Download Size |
| - closureDownloadSize | integer | No | Closure Download Size |
| - provenance | Combination | No | Provenance |
3.1. Property version
Title: Format version (must be 3)
| Type | const |
| Required | Yes |
| Same definition as | version |
Description: Must be 3.
This is a guard that allows us to continue evolving this format.
Here is the rough version history:
-
Version 0:
.narinfoline-oriented format -
Version 1: Original JSON format, with ugly
"r:sha256"inherited from.narinfoformat. -
Version 2: Use structured JSON type for
ca -
Version 3: Use structured JSON type for
signatures
3.2. Property path
Title: Store Path
| Type | string |
| Required | No |
| Same definition as | path |
Description: Store path to the given store object.
Note: This field may not be present in all contexts, such as when the path is used as the key and the the store object info the value in map.
3.3. Property narHash
Title: NAR Hash
| Type | string |
| Required | Yes |
| Same definition as | narHash |
Description: Hash of the file system object part of the store object when serialized as a Nix Archive.
3.4. Property narSize
Title: NAR Size
| Type | integer |
| Required | Yes |
| Same definition as | narSize |
Description: Size of the file system object part of the store object when serialized as a Nix Archive.
3.5. Property references
Title: References
| Type | array |
| Required | Yes |
| Same definition as | references |
Description: An array of store paths, possibly including this one.
3.6. Property ca
Title: Content Address
| Type | combining |
| Required | Yes |
| Additional properties | Any type allowed |
| Same definition as | ca |
Description: If the store object is content-addressed,
this is the content address of this store object’s file system object, used to compute its store path.
Otherwise (i.e. if it is input-addressed), this is null.
3.7. Property storeDir
Title: Store Directory
| Type | string |
| Required | Yes |
| Same definition as | storeDir |
Description: The path to the store directory this store object belongs within (e.g. /nix/store).
3.8. Property deriver
Title: Deriver
| Type | combining |
| Required | Yes |
| Additional properties | Any type allowed |
| Defined in | #/$defs/impure/properties/deriver |
Description: If known, the path to the store derivation from which this store object was produced.
Otherwise null.
This is an “impure” field that may not be included in certain contexts.
| One of(Option) |
|---|
| Store Path |
| item 1 |
3.8.1. Property Store Path
Title: Store Path
| Type | string |
| Required | No |
| Same definition as | path |
Description: A store path identifying a store object.
This schema describes the JSON representation of store paths as used in various Nix JSON APIs.
Format
Store paths in JSON are represented as strings containing just the hash and name portion, without the store directory prefix.
For example: "g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo.drv"
(If the store dir is /nix/store, then this corresponds to the path /nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo.drv.)
Structure
The format follows this pattern: ${digest}-${name}
- hash: Digest rendered in Nix32 (20 hash bytes become 32 ASCII characters)
- name: The package name and optional version/suffix information
3.8.2. Property item 1
| Type | null |
| Required | No |
3.9. Property registrationTime
Title: Registration Time
| Type | integer or null |
| Required | Yes |
| Defined in | #/$defs/impure/properties/registrationTime |
Description: If known, when this derivation was added to the store (Unix timestamp).
Otherwise null.
This is an “impure” field that may not be included in certain contexts.
3.10. Property ultimate
Title: Ultimate
| Type | boolean |
| Required | Yes |
| Defined in | #/$defs/impure/properties/ultimate |
Description: Whether this store object is trusted because we built it ourselves, rather than substituted a build product from elsewhere.
This is an “impure” field that may not be included in certain contexts.
3.11. Property signatures
Title: Signatures
| Type | array |
| Required | Yes |
| Defined in | #/$defs/impure/properties/signatures |
Description: Signatures claiming that this store object is what it claims to be. Not relevant for content-addressed store objects, but useful for input-addressed store objects.
This is an “impure” field that may not be included in certain contexts.
| Array restrictions | |
|---|---|
| Min items | N/A |
| Max items | N/A |
| Items unicity | False |
| Additional items | False |
| Tuple validation | See below |
| Each item of this array must be | Description |
|---|---|
| Signature | A cryptographic signature along with the name of the key that produced it. … |
3.11.1. Signature
Title: Signature
| Type | object |
| Required | No |
| Additional properties | Any type allowed |
| Same definition as | Signature |
Description: A cryptographic signature along with the name of the key that produced it.
This schema describes the JSON representation of signatures as used in various Nix JSON APIs.
Version History
-
Version 1: Colon-separated string in the format
<key-name>:<signature-in-Base64> -
Version 2: Structured object with
keyNameandsigfields
3.12. Property closureSize
Title: Closure Size
| Type | integer |
| Required | No |
| Defined in | #/$defs/impure/properties/closureSize |
Description: The total size of this store object and every other object in its closure.
This field is not stored at all, but computed by traversing the other fields across all the store objects in a closure.
| Restrictions | |
|---|---|
| Minimum | ≥ 0 |
3.13. Property url
Title: URL
| Type | string |
| Required | Yes |
Description: Where to download a compressed archive of the file system objects of this store object.
This is an impure “
.narinfo” field that may not be included in certain contexts.
3.14. Property compression
Title: Compression
| Type | string |
| Required | Yes |
Description: The compression format that the archive is in.
This is an impure “
.narinfo” field that may not be included in certain contexts.
3.15. Property downloadHash
Title: Download Hash
| Type | string |
| Required | Yes |
| Defined in | JSON format for Hash |
Description: A digest for the compressed archive itself, as opposed to the data contained within.
This is an impure “
.narinfo” field that may not be included in certain contexts.
Examples:
"sha256-ungWv48Bz+pBQUDeXa4iI7ADYaOWF3qctBD/YfIAFa0="
"sha512-IEqPxt2oLwoM7XvrjgikFlfBbvRosiioJ5vjMacDwzWW/RXBOxsH+aodO+pXeJygMa2Fx6cd1wNU7GMSOMo0RQ=="
| Restrictions | |
|---|---|
| Must match regular expression | ^(blake3|md5|sha1|sha256|sha512)-[A-Za-z0-9+/]+=*$ Test |
3.16. Property downloadSize
Title: Download Size
| Type | integer |
| Required | Yes |
Description: The size of the compressed archive itself.
This is an impure “
.narinfo” field that may not be included in certain contexts.
| Restrictions | |
|---|---|
| Minimum | ≥ 0 |
3.17. Property closureDownloadSize
Title: Closure Download Size
| Type | integer |
| Required | No |
Description: The total size of the compressed archive itself for this object, and the compressed archive of every object in this object’s closure.
This is an impure “
.narinfo” field that may not be included in certain contexts.
This field is not stored at all, but computed by traversing the other fields across all the store objects in a closure.
| Restrictions | |
|---|---|
| Minimum | ≥ 0 |
3.18. Property provenance
Title: Provenance
| Type | combining |
| Required | No |
| Additional properties | Any type allowed |
Description: Provenance information about the store object, or null if not available.
| One of(Option) |
|---|
| item 0 |
| Provenance |
3.18.1. Property item 0
| Type | null |
| Required | No |
3.18.2. Property Provenance
Title: Provenance
| Type | combining |
| Required | No |
| Additional properties | Any type allowed |
| Same definition as | Provenance |
Description: > Warning
This JSON format is currently experimental and subject to change.
Provenance describes where a store object came from, such as the derivation that built it, the flake output that produced that derivation, or the source tree that it was fetched from.
It appears in the provenance field of store object info, as shown by e.g. nix path-info --json.
A provenance record is a JSON object with a type field that determines what other fields are present.
Most types have a next field that contains the provenance of the thing from which this one was derived (or null if that isn’t known).
Thus, provenance forms a chain, going from the store object itself back to its ultimate origin.
For example, a store object substituted from a binary cache might have copied provenance, whose next is build provenance, whose next is derivation provenance, and so on.
Future versions of Nix may add new provenance types, and new fields to existing types.
Consumers should therefore accept provenance records with a type that they don’t recognise, and ignore fields that they don’t recognise.
Nix itself preserves records of unknown types unchanged.
Examples
Minimal store object (content-addressed)
{
"ca": {
"hash": "sha256-EMIJ+giQ/gLIWoxmPKjno3zHZrxbGymgzGGyZvZBIdM=",
"method": "nar"
},
"narHash": "sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc=",
"narSize": 34878,
"references": [
"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar",
"n5wkd9frr45pa74if5gpz9j7mifg27fh-foo"
],
"storeDir": "/nix/store",
"version": 3
}
Store object with impure fields
{
"ca": {
"hash": "sha256-EMIJ+giQ/gLIWoxmPKjno3zHZrxbGymgzGGyZvZBIdM=",
"method": "nar"
},
"deriver": "g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar.drv",
"narHash": "sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc=",
"narSize": 34878,
"references": [
"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar",
"n5wkd9frr45pa74if5gpz9j7mifg27fh-foo"
],
"registrationTime": 23423,
"signatures": [
{
"keyName": "asdf",
"sig": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="
},
{
"keyName": "qwer",
"sig": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="
}
],
"storeDir": "/nix/store",
"ultimate": true,
"version": 3
}
Minimal store object (empty)
{
"ca": null,
"narHash": "sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc=",
"narSize": 0,
"references": [],
"storeDir": "/nix/store",
"version": 3
}
Store object with all impure fields
{
"ca": null,
"deriver": null,
"narHash": "sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc=",
"narSize": 0,
"references": [],
"registrationTime": null,
"signatures": [],
"storeDir": "/nix/store",
"ultimate": false,
"version": 3
}
NAR info (minimal)
{
"ca": {
"hash": "sha256-EMIJ+giQ/gLIWoxmPKjno3zHZrxbGymgzGGyZvZBIdM=",
"method": "nar"
},
"narHash": "sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc=",
"narSize": 34878,
"references": [
"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar",
"n5wkd9frr45pa74if5gpz9j7mifg27fh-foo"
],
"storeDir": "/nix/store",
"version": 3
}
NAR info (with binary cache fields)
{
"ca": {
"hash": "sha256-EMIJ+giQ/gLIWoxmPKjno3zHZrxbGymgzGGyZvZBIdM=",
"method": "nar"
},
"compression": "xz",
"deriver": "g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar.drv",
"downloadHash": "sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc=",
"downloadSize": 4029176,
"narHash": "sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc=",
"narSize": 34878,
"references": [
"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar",
"n5wkd9frr45pa74if5gpz9j7mifg27fh-foo"
],
"registrationTime": 23423,
"signatures": [
{
"keyName": "asdf",
"sig": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="
},
{
"keyName": "qwer",
"sig": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="
}
],
"storeDir": "/nix/store",
"ultimate": true,
"url": "nar/1w1fff338fvdw53sqgamddn1b2xgds473pv6y13gizdbqjv4i5p3.nar.xz",
"version": 3
}