Store

Title: Store

Typeobject
RequiredNo
Additional propertiesAny type allowed

Description: Experimental JSON representation of a Nix Store.

This schema describes the JSON serialization of a Nix store. We use it for (de)serializing in-memory "dummy stores" used for testing, but in principle the data represented in this schema could live in any type of store.

Warning

This JSON format is currently experimental and subject to change.

PropertyTypePatternTitle/Description
+ configobjectNoStore Configuration
+ contentsobjectNoStore Objects
+ derivationsobjectNoDerivations
+ buildTraceobjectNoBuild Trace

1. Property config

Title: Store Configuration

Typeobject
RequiredYes
Additional propertiesNot allowed
Defined in#/$defs/storeConfig

Description: Configuration for the store, including the store directory path.

PropertyTypePatternTitle/Description
+ storestringNoStore Directory

1.1. Property store

Title: Store Directory

Typestring
RequiredYes

Description: The store directory path (e.g., /nix/store).

2. Property contents

Title: Store Objects

Typeobject
RequiredYes
Additional propertiesNot allowed

Description: Map of store path base names to store objects.

PropertyTypePatternTitle/Description
- ^[0123456789abcdfghijklmnpqrsvwxyz]{32}-.+$objectYesStore Object

2.1. Pattern Property Store Object

All properties whose name matches the regular expression ^[0123456789abcdfghijklmnpqrsvwxyz]{32}-.+$ (Test) must respect the following conditions

Title: Store Object

Typeobject
RequiredNo
Additional propertiesNot allowed
PropertyTypePatternTitle/Description
+ infoobjectNoStore Object Info
+ contentsobjectNoFile System Object Contents

2.1.1. Property info

Title: Store Object Info

Typeobject
RequiredYes
Additional propertiesNot allowed
Defined in./store-object-info-v2.yaml#/$defs/impure

Description: Metadata about the store object including hash, size, references, etc.

PropertyTypePatternTitle/Description
+ versionconstNoFormat version (must be 2)
- pathstringNoStore Path
+ narHashstringNoNAR Hash
+ narSizeintegerNoNAR Size
+ referencesarrayNoReferences
+ caobjectNoContent Address
+ storeDirstringNoStore Directory
+ deriverCombinationNoDeriver
+ registrationTimeinteger or nullNoRegistration Time
+ ultimatebooleanNoUltimate
+ signaturesarray of stringNoSignatures
- closureSizeintegerNoClosure Size
2.1.1.1. Property version

Title: Format version (must be 2)

Typeconst
RequiredYes
Defined in#/$defs/base/properties/version

Description: Must be 2. This is a guard that allows us to continue evolving this format. Here is the rough version history:

  • Version 0: .narinfo line-oriented format

  • Version 1: Original JSON format, with ugly "r:sha256" inherited from .narinfo format.

  • Version 2: Use structured JSON type for ca

Specific value: 2

2.1.1.2. Property path

Title: Store Path

Typestring
RequiredNo
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 length34
Must match regular expression^[0123456789abcdfghijklmnpqrsvwxyz]{32}-.+$ Test
2.1.1.3. Property narHash

Title: NAR Hash

Typestring
RequiredYes
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.1.1.4. Property narSize

Title: NAR Size

Typeinteger
RequiredYes
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.1.1.5. Property references

Title: References

Typearray
RequiredYes
Defined in#/$defs/base/properties/references

Description: An array of store paths, possibly including this one.

Array restrictions
Min itemsN/A
Max itemsN/A
Items unicityFalse
Additional itemsFalse
Tuple validationSee below
Each item of this array must beDescription
Store PathA store path identifying a store object. ...
2.1.1.5.1. Store Path

Title: Store Path

Typestring
RequiredNo
Same definition aspath

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 a custom variant of Base32 (20 arbitrary bytes become 32 ASCII characters)
  • name: The package name and optional version/suffix information
2.1.1.6. Property ca

Title: Content Address

Typecombining
RequiredYes
Additional propertiesAny 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.1.1.6.1. Property item 0
Typeconst
RequiredNo

Specific value: null

2.1.1.6.2. Property Content Address

Title: Content Address

Typeobject
RequiredNo
Additional propertiesNot allowed
Defined inJSON 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 method is richer), nor simply a content address of a store object (the hash doesn't account for the references). It should thus only be used in contexts where the references are also known / otherwise made tamper-resistant.

PropertyTypePatternTitle/Description
+ methodenum (of string)NoContent-Addressing Method
+ hashstringNoContent Address
2.1.1.6.2.1. Property method

Title: Content-Addressing Method

Typeenum (of string)
RequiredYes
Defined inJSON 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"
2.1.1.6.2.2. Property hash

Title: Content Address

Typestring
RequiredYes
Defined inJSON 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
2.1.1.7. Property storeDir

Title: Store Directory

Typestring
RequiredYes
Defined in#/$defs/base/properties/storeDir

Description: The store directory this store object belongs to (e.g. /nix/store).

2.1.1.8. Property deriver

Title: Deriver

Typecombining
RequiredYes
Additional propertiesAny 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.1.1.8.1. Property Store Path

Title: Store Path

Typestring
RequiredNo
Same definition aspath

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 a custom variant of Base32 (20 arbitrary bytes become 32 ASCII characters)
  • name: The package name and optional version/suffix information
2.1.1.8.2. Property item 1
Typenull
RequiredNo
2.1.1.9. Property registrationTime

Title: Registration Time

Typeinteger or null
RequiredYes

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.1.1.10. Property ultimate

Title: Ultimate

Typeboolean
RequiredYes

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.1.1.11. Property signatures

Title: Signatures

Typearray of string
RequiredYes

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 itemsN/A
Max itemsN/A
Items unicityFalse
Additional itemsFalse
Tuple validationSee below
Each item of this array must beDescription
signatures items-
2.1.1.11.1. signatures items
Typestring
RequiredNo
2.1.1.12. Property closureSize

Title: Closure Size

Typeinteger
RequiredNo

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.1.2. Property contents

Title: File System Object Contents

Typecombining
RequiredYes
Additional propertiesAny type allowed
Defined in./file-system-object-v1.yaml

Description: The actual file system object contents of this store path.

PropertyTypePatternTitle/Description
+ typeenum (of string)No-
2.1.2.1. Property Regular File

Title: Regular File

Typeobject
RequiredNo
Additional propertiesNot allowed
Defined inIn this schema

Description: See Regular File in the manual for details.

PropertyTypePatternTitle/Description
- typeconstNo-
+ contentsstringNoFile contents
- executablebooleanNoWhether the file is executable.
2.1.2.1.1. Property type
Typeconst
RequiredNo

Specific value: "regular"

2.1.2.1.2. Property contents
Typestring
RequiredYes

Description: File contents

2.1.2.1.3. Property executable
Typeboolean
RequiredNo
Defaultfalse

Description: Whether the file is executable.

2.1.2.2. Property Directory

Title: Directory

Typeobject
RequiredNo
Additional propertiesNot allowed
Defined inIn this schema

Description: See Directory in the manual for details.

PropertyTypePatternTitle/Description
- typeconstNo-
+ entriesobjectNoMap of names to nested file system objects (for type=directory)
2.1.2.2.1. Property type
Typeconst
RequiredNo

Specific value: "directory"

2.1.2.2.2. Property entries
Typeobject
RequiredYes
Additional propertiesEach additional property must conform to the schema

Description: Map of names to nested file system objects (for type=directory)

PropertyTypePatternTitle/Description
- objectNoFile System Object
2.1.2.2.2.1. Property File System Object

Title: File System Object

Typecombining
RequiredNo
Additional propertiesAny type allowed
Same definition ascontents

Description: This schema describes the JSON representation of Nix's File System Object.

The schema is recursive because file system objects contain other file system objects.

Title: Symbolic Link

Typeobject
RequiredNo
Additional propertiesNot allowed
Defined inIn this schema

Description: See Symbolic Link in the manual for details.

PropertyTypePatternTitle/Description
- typeconstNo-
+ targetstringNoTarget path of the symlink.
2.1.2.3.1. Property type
Typeconst
RequiredNo

Specific value: "symlink"

2.1.2.3.2. Property target
Typestring
RequiredYes

Description: Target path of the symlink.

2.1.2.4. Property type
Typeenum (of string)
RequiredYes

Must be one of:

  • "regular"
  • "symlink"
  • "directory"

3. Property derivations

Title: Derivations

Typeobject
RequiredYes
Additional propertiesNot allowed

Description: Map of store path base names (always ending in .drv) to derivations.

PropertyTypePatternTitle/Description
- ^[0123456789abcdfghijklmnpqrsvwxyz]{32}-.+.drv$objectYesDerivation

3.1. Pattern Property Derivation

All properties whose name matches the regular expression ^[0123456789abcdfghijklmnpqrsvwxyz]{32}-.+\.drv$ (Test) must respect the following conditions

Title: Derivation

Typeobject
RequiredNo
Additional propertiesAny type allowed
Defined in./derivation-v4.yaml

Description: Experimental JSON representation of a Nix derivation (version 4).

This schema describes the JSON representation of Nix's Derivation type.

Warning

This JSON format is currently experimental and subject to change.

PropertyTypePatternTitle/Description
+ namestringNoDerivation name
+ versionconstNoFormat version (must be 4)
+ outputsobjectNoOutput specifications
+ inputsobjectNoDerivation inputs
+ systemstringNoBuild system type
+ builderstringNoBuild program path
+ argsarray of stringNoBuilder arguments
+ envobjectNoEnvironment variables
- structuredAttrsobjectNoStructured attributes

3.1.1. Property name

Title: Derivation name

Typestring
RequiredYes

Description: The name of the derivation. Used when calculating store paths for the derivation’s outputs.

3.1.2. Property version

Title: Format version (must be 4)

Typeconst
RequiredYes

Description: Must be 4. This is a guard that allows us to continue evolving this format. The choice of 3 is fairly arbitrary, but corresponds to this informal version:

  • Version 0: ATerm format

  • Version 1: Original JSON format, with ugly "r:sha256" inherited from ATerm format.

  • Version 2: Separate method and hashAlgo fields in output specs

  • Version 3: Drop store dir from store paths, just include base name.

  • Version 4: Two cleanups, batched together to lesson churn:

    • Reorganize inputs into nested structure (inputs.srcs and inputs.drvs)

    • Use canonical content address JSON format for floating content addressed derivation outputs.

Note that while this format is experimental, the maintenance of versions is best-effort, and not promised to identify every change.

Specific value: 4

3.1.3. Property outputs

Title: Output specifications

Typeobject
RequiredYes
Additional propertiesEach additional property must conform to the schema

Description: Information about the output paths of the derivation. This is a JSON object with one member per output, where the key is the output name and the value is a JSON object as described.

Example

"outputs": {
  "out": {
    "method": "nar",
    "hashAlgo": "sha256",
    "hash": "6fc80dcc62179dbc12fc0b5881275898f93444833d21b89dfe5f7fbcbb1d0d62"
  }
}
PropertyTypePatternTitle/Description
- objectNoDerivation Output
3.1.3.1. Property Derivation Output

Title: Derivation Output

Typecombining
RequiredNo
Additional propertiesAny type allowed
Defined in#/$defs/output/overall

Description: A single output of a derivation, with different variants for different output types.

3.1.3.1.1. Property Input-Addressed Output

Title: Input-Addressed Output

Typeobject
RequiredNo
Additional propertiesNot allowed
Defined in#/$defs/output/inputAddressed

Description: The traditional non-fixed-output derivation type. The output path is determined from the derivation itself.

See Input-addressing derivation outputs for more details.

PropertyTypePatternTitle/Description
+ pathstringNoOutput path
3.1.3.1.1.1. Property path

Title: Output path

Typestring
RequiredYes
Defined instore-path-v1.yaml

Description: The output path determined from the derivation itself.

Restrictions
Min length34
Must match regular expression^[0123456789abcdfghijklmnpqrsvwxyz]{32}-.+$ Test
3.1.3.1.2. Property Fixed Content-Addressed Output

Title: Fixed Content-Addressed Output

Typeobject
RequiredNo
Additional propertiesNot allowed
Defined in#/$defs/output/caFixed

Description: The output is content-addressed, and the content-address is fixed in advance.

See Fixed-output content-addressing for more details.

PropertyTypePatternTitle/Description
+ methodenum (of string)NoContent-Addressing Method
+ hashstringNoExpected hash value
3.1.3.1.2.1. Property method

Title: Content-Addressing Method

Typeenum (of string)
RequiredYes
Defined inJSON format for ContentAddress

Description: Method of content addressing used for this output.

Must be one of:

  • "flat"
  • "nar"
  • "text"
  • "git"
3.1.3.1.2.2. Property hash

Title: Expected hash value

Typestring
RequiredYes
Defined inJSON format for Hash

Description: The expected content hash.

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.1.3.1.3. Property Floating Content-Addressed Output

Title: Floating Content-Addressed Output

Typeobject
RequiredNo
Additional propertiesNot allowed
Defined in#/$defs/output/caFloating

Description: Floating-output derivations, whose outputs are content addressed, but not fixed, and so the output paths are dynamically calculated from whatever the output ends up being.

See Floating Content-Addressing for more details.

PropertyTypePatternTitle/Description
+ methodenum (of string)NoContent-Addressing Method
+ hashAlgoenum (of string)NoHash algorithm
3.1.3.1.3.1. Property method

Title: Content-Addressing Method

Typeenum (of string)
RequiredYes
Same definition asmethod

Description: Method of content addressing used for this output.

3.1.3.1.3.2. Property hashAlgo

Title: Hash algorithm

Typeenum (of string)
RequiredYes
Defined inJSON format for Hash

Description: What hash algorithm to use for the given method of content-addressing.

Must be one of:

  • "blake3"
  • "md5"
  • "sha1"
  • "sha256"
  • "sha512"
3.1.3.1.4. Property Deferred Output

Title: Deferred Output

Typeobject
RequiredNo
Additional propertiesAny type allowed
Defined in#/$defs/output/deferred

Description: Input-addressed output which depends on a (CA) derivation whose outputs (and thus their content-address are not yet known.

3.1.3.1.5. Property Impure Output

Title: Impure Output

Typeobject
RequiredNo
Additional propertiesNot allowed
Defined in#/$defs/output/impure

Description: Impure output which is just like a floating content-addressed output, but this derivation runs without sandboxing. As such, we don't record it in the build trace, under the assumption that if we need it again, we should rebuild it, as it might produce something different.

PropertyTypePatternTitle/Description
+ impureconstNo-
+ methodenum (of string)NoContent-Addressing Method
+ hashAlgoenum (of string)NoHash algorithm
3.1.3.1.5.1. Property impure
Typeconst
RequiredYes

Specific value: true

3.1.3.1.5.2. Property method

Title: Content-Addressing Method

Typeenum (of string)
RequiredYes
Same definition asmethod

Description: How the file system objects will be serialized for hashing.

3.1.3.1.5.3. Property hashAlgo

Title: Hash algorithm

Typeenum (of string)
RequiredYes
Defined inJSON format for Hash

Description: How the serialization will be hashed.

Must be one of:

  • "blake3"
  • "md5"
  • "sha1"
  • "sha256"
  • "sha512"

3.1.4. Property inputs

Title: Derivation inputs

Typeobject
RequiredYes
Additional propertiesNot allowed

Description: Input dependencies for the derivation, organized into source paths and derivation dependencies.

PropertyTypePatternTitle/Description
+ srcsarrayNoInput source paths
+ drvsobjectNoInput derivations
3.1.4.1. Property srcs

Title: Input source paths

Typearray
RequiredYes

Description: List of store paths on which this derivation depends.

Example

"srcs": [
  "47y241wqdhac3jm5l7nv0x4975mb1975-separate-debug-info.sh",
  "56d0w71pjj9bdr363ym3wj1zkwyqq97j-fix-pop-var-context-error.patch"
]
Array restrictions
Min itemsN/A
Max itemsN/A
Items unicityFalse
Additional itemsFalse
Tuple validationSee below
Each item of this array must beDescription
Store PathA store path identifying a store object. ...
3.1.4.1.1. Store Path

Title: Store Path

Typestring
RequiredNo
Same definition aspath

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 a custom variant of Base32 (20 arbitrary bytes become 32 ASCII characters)
  • name: The package name and optional version/suffix information
3.1.4.2. Property drvs

Title: Input derivations

Typeobject
RequiredYes
Additional propertiesNot allowed

Description: Mapping of derivation paths to lists of output names they provide.

Example

"drvs": {
  "6lkh5yi7nlb7l6dr8fljlli5zfd9hq58-curl-7.73.0.drv": ["dev"],
  "fn3kgnfzl5dzym26j8g907gq3kbm8bfh-unzip-6.0.drv": ["out"]
}

specifies that this derivation depends on the dev output of curl, and the out output of unzip.

PropertyTypePatternTitle/Description
- ^[0123456789abcdfghijklmnpqrsvwxyz]{32}-.+.drv$CombinationYesStore Path
3.1.4.2.1. Pattern Property Store Path

All properties whose name matches the regular expression ^[0123456789abcdfghijklmnpqrsvwxyz]{32}-.+\.drv$ (Test) must respect the following conditions

Title: Store Path

Typecombining
RequiredNo
Additional propertiesAny type allowed

Description: A store path to a derivation, mapped to the outputs of that derivation.

3.1.4.2.1.1. Property Output Names

Title: Output Names

Typearray
RequiredNo
Defined in#/$defs/outputNames

Description: Set of names of derivation outputs to depend on

Array restrictions
Min itemsN/A
Max itemsN/A
Items unicityFalse
Additional itemsFalse
Tuple validationSee below
Each item of this array must beDescription
Output nameName of the derivation output to depend on
3.1.4.2.1.1.1. Output name

Title: Output name

Typestring
RequiredNo
Defined in#/$defs/outputName

Description: Name of the derivation output to depend on

3.1.4.2.1.2. Property Dynamic Outputs

Title: Dynamic Outputs

Typeobject
RequiredNo
Additional propertiesAny type allowed
Defined in#/$defs/dynamicOutputs

Description: Experimental feature: dynamic-derivations

This recursive data type allows for depending on outputs of outputs.

PropertyTypePatternTitle/Description
- outputsarrayNoOutput Names
- dynamicOutputsobjectNoDynamic Outputs
3.1.4.2.1.2.1. Property outputs

Title: Output Names

Typearray
RequiredNo
Same definition asOutput Names

Description: Set of names of derivation outputs to depend on

3.1.4.2.1.2.2. Property dynamicOutputs

Title: Dynamic Outputs

Typeobject
RequiredNo
Additional propertiesAny type allowed
Same definition asDynamic Outputs

Description: Experimental feature: dynamic-derivations

This recursive data type allows for depending on outputs of outputs.

3.1.5. Property system

Title: Build system type

Typestring
RequiredYes

Description: The system type on which this derivation is to be built (e.g. x86_64-linux).

3.1.6. Property builder

Title: Build program path

Typestring
RequiredYes

Description: Absolute path of the program used to perform the build. Typically this is the bash shell (e.g. /nix/store/r3j288vpmczbl500w6zz89gyfa4nr0b1-bash-4.4-p23/bin/bash).

3.1.7. Property args

Title: Builder arguments

Typearray of string
RequiredYes

Description: Command-line arguments passed to the builder.

Array restrictions
Min itemsN/A
Max itemsN/A
Items unicityFalse
Additional itemsFalse
Tuple validationSee below
Each item of this array must beDescription
args items-
3.1.7.1. args items
Typestring
RequiredNo

3.1.8. Property env

Title: Environment variables

Typeobject
RequiredYes
Additional propertiesEach additional property must conform to the schema

Description: Environment variables passed to the builder.

PropertyTypePatternTitle/Description
- stringNo-
3.1.8.1. Property additionalProperties
Typestring
RequiredNo

3.1.9. Property structuredAttrs

Title: Structured attributes

Typeobject
RequiredNo
Additional propertiesAny type allowed

Description: Structured Attributes, only defined if the derivation contains them. Structured attributes are JSON, and thus embedded as-is.

PropertyTypePatternTitle/Description
- objectNo-

4. Property buildTrace

Title: Build Trace

Typeobject
RequiredYes
Additional propertiesNot allowed

Description: Map of output hashes (base64 SHA256) to maps of output names to realisations. Records which outputs have been built and their realisations. See Build Trace for more details.

PropertyTypePatternTitle/Description
- ^[A-Za-z0-9+/]{43}=$objectYes-

4.1. Pattern Property ^[A-Za-z0-9+/]{43}=$

All properties whose name matches the regular expression ^[A-Za-z0-9+/]{43}=$ (Test) must respect the following conditions

Typeobject
RequiredNo
Additional propertiesEach additional property must conform to the schema
PropertyTypePatternTitle/Description
- objectNoBuild Trace Value

4.1.1. Property Build Trace Value

Title: Build Trace Value

Typeobject
RequiredNo
Additional propertiesAny type allowed
Defined in./build-trace-entry-v1.yaml#/$defs/value

Description: A build trace entry is a key-value pair. This is the "value" part, describing an output.

PropertyTypePatternTitle/Description
+ outPathstringNoOutput Store Path
+ dependentRealisationsobjectNoUnderlying Base Build Trace
+ signaturesarray of stringNoBuild Signatures
4.1.1.1. Property outPath

Title: Output Store Path

Typestring
RequiredYes
Defined instore-path-v1.yaml

Description: The path to the store object that resulted from building this derivation for the given output name.

Restrictions
Min length34
Must match regular expression^[0123456789abcdfghijklmnpqrsvwxyz]{32}-.+$ Test
4.1.1.2. Property dependentRealisations

Title: Underlying Base Build Trace

Typeobject
RequiredYes
Additional propertiesNot allowed

Description: This is for derived build trace entries to ensure coherence.

Keys are derivation output IDs (same format as the main id field). Values are the store paths that those dependencies resolved to.

As described in the linked section on derived build trace traces, derived build trace entries must be kept in addition and not instead of the underlying base build entries. This is the set of base build trace entries that this derived build trace is derived from. (The set is also a map since this miniature base build trace must be coherent, mapping each key to a single value.)

PropertyTypePatternTitle/Description
- ^sha256:[0-9a-f]{64}![a-zA-Z_][a-zA-Z0-9_-]*$stringYesDependent Store Path
4.1.1.2.1. Pattern Property Dependent Store Path

All properties whose name matches the regular expression ^sha256:[0-9a-f]{64}![a-zA-Z_][a-zA-Z0-9_-]*$ (Test) must respect the following conditions

Title: Dependent Store Path

Typestring
RequiredNo
Defined instore-path-v1.yaml

Description: Store path that this dependency resolved to during the build

Restrictions
Min length34
Must match regular expression^[0123456789abcdfghijklmnpqrsvwxyz]{32}-.+$ Test
4.1.1.3. Property signatures

Title: Build Signatures

Typearray of string
RequiredYes

Description: A set of cryptographic signatures attesting to the authenticity of this build trace entry.

Array restrictions
Min itemsN/A
Max itemsN/A
Items unicityFalse
Additional itemsFalse
Tuple validationSee below
Each item of this array must beDescription
SignatureA single cryptographic signature
4.1.1.3.1. Signature

Title: Signature

Typestring
RequiredNo

Description: A single cryptographic signature


Examples

Empty store

{
  "buildTrace": {},
  "config": {
    "store": "/nix/store"
  },
  "contents": {},
  "derivations": {}
}

Store with one file

{
  "buildTrace": {},
  "config": {
    "store": "/nix/store"
  },
  "contents": {
    "5hizn7xyyrhxr0k2magvxl5ccvk0ci9n-my-file": {
      "contents": {
        "contents": "asdf",
        "executable": false,
        "type": "regular"
      },
      "info": {
        "ca": {
          "hash": "sha256-f1eduuSIYC1BofXA1tycF79Ai2NSMJQtUErx5DxLYSU=",
          "method": "nar"
        },
        "deriver": null,
        "narHash": "sha256-f1eduuSIYC1BofXA1tycF79Ai2NSMJQtUErx5DxLYSU=",
        "narSize": 120,
        "references": [],
        "registrationTime": null,
        "signatures": [],
        "storeDir": "/nix/store",
        "ultimate": false,
        "version": 2
      }
    }
  },
  "derivations": {}
}

Store with one derivation

{
  "buildTrace": {},
  "config": {
    "store": "/nix/store"
  },
  "contents": {},
  "derivations": {
    "rlqjbbb65ggcx9hy577hvnn929wz1aj0-foo.drv": {
      "args": [],
      "builder": "",
      "env": {},
      "inputs": {
        "drvs": {},
        "srcs": []
      },
      "name": "foo",
      "outputs": {},
      "system": "",
      "version": 4
    }
  }
}