Title: Derivation Options
| |
| Type | object |
| Required | No |
| Additional properties | Not allowed |
Description: JSON representation of Nix's DerivationOptions type.
This schema describes various build-time options and constraints that can be specified for a derivation.
Warning
This JSON format is currently
experimental
and subject to change.
1. Property outputChecks
Title: Output Check
| |
| Type | combining |
| Required | Yes |
| Additional properties | Any type allowed |
Description: Constraints on what the derivation's outputs can and cannot reference.
Can either apply to all outputs or be specified per output.
1.1. Property Output Checks For All Outputs
Title: Output Checks For All Outputs
| |
| Type | object |
| Required | No |
| Additional properties | Not allowed |
Description: Output checks that apply to all outputs of the derivation.
| Property | Type | Pattern | Title/Description |
| + forAllOutputs | object | No | Output Check Specification |
1.1.1. Property forAllOutputs
Title: Output Check Specification
| |
| Type | object |
| Required | Yes |
| Additional properties | Not allowed |
| Defined in | #/$defs/outputCheckSpec |
Description: Constraints on what a specific output can reference.
1.1.1.1. Property ignoreSelfRefs
Title: Ignore Self References
Description: Whether references from this output to itself should be ignored when checking references.
1.1.1.2. Property maxSize
Title: Maximum Size
| |
| Type | integer or null |
| Required | Yes |
Description: Maximum allowed size of this output in bytes, or null for no limit.
1.1.1.3. Property maxClosureSize
Title: Maximum Closure Size
| |
| Type | integer or null |
| Required | Yes |
Description: Maximum allowed size of this output's closure in bytes, or null for no limit.
1.1.1.4. Property allowedReferences
Title: Allowed References
| |
| Type | combining |
| Required | Yes |
| Additional properties | Any type allowed |
Description: If set, the output can only reference paths in this list.
If null, no restrictions apply.
1.1.1.4.1. Property item 0
| 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 |
| drvRef | - |
1.1.1.4.1.1. drvRef
| |
| Type | combining |
| Required | No |
| Additional properties | Any type allowed |
| Defined in | #/$defs/drvRef |
1.1.1.4.1.1.1. Property Current derivation Output Reference
Title: Current derivation Output Reference
| |
| Type | object |
| Required | No |
| Additional properties | Not allowed |
Description: A reference to a specific output of the current derivation.
| Property | Type | Pattern | Title/Description |
| + drvPath | const | No | This derivation |
| + output | string | No | Output Name |
1.1.1.4.1.1.1.1. Property drvPath
Title: This derivation
Description: Won't be confused for a deriving path
Specific value: "self"
1.1.1.4.1.1.1.2. Property output
Title: Output Name
Description: The name of the output being referenced.
1.1.1.4.1.1.2. Property Deriving Path
Title: Deriving Path
| |
| Type | combining |
| Required | No |
| Additional properties | Any type allowed |
| Defined in | deriving-path-v1.yaml |
Description: This schema describes the JSON representation of Nix's Deriving Path.
1.1.1.4.1.1.2.1. Property Constant
Title: Constant
| |
| Type | string |
| Required | No |
| Defined in | store-path-v1.yaml |
Description: See Constant deriving path.
| Restrictions | |
| Min length | 34 |
| Must match regular expression | ^[0123456789abcdfghijklmnpqrsvwxyz]{32}-.+$ Test |
1.1.1.4.1.1.2.2. Property Output
Title: Output
| |
| Type | object |
| Required | No |
| Additional properties | Not allowed |
Description: See Output deriving path.
| Property | Type | Pattern | Title/Description |
| + drvPath | object | No | Deriving Path |
| + output | string | No | The name of an output produced by that derivation (e.g. "out", "doc", etc.).
|
1.1.1.4.1.1.2.2.1. Property drvPath
Title: Deriving Path
| |
| Type | combining |
| Required | Yes |
| Additional properties | Any type allowed |
| Same definition as | Deriving Path |
Description: A deriving path to a Derivation, whose output is being referred to.
1.1.1.4.1.1.2.2.2. Property output
Description: The name of an output produced by that derivation (e.g. "out", "doc", etc.).
1.1.1.4.2. Property item 1
1.1.1.5. Property allowedRequisites
Title: Allowed Requisites
| |
| Type | combining |
| Required | Yes |
| Additional properties | Any type allowed |
Description: If set, the output's closure can only contain paths in this list.
If null, no restrictions apply.
1.1.1.5.1. Property item 0
| 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 |
| drvRef | - |
1.1.1.5.1.1. drvRef
1.1.1.5.2. Property item 1
1.1.1.6. Property disallowedReferences
Title: Disallowed References
Description: The output must not reference any paths in this list.
| 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 |
| drvRef | - |
1.1.1.6.1. drvRef
1.1.1.7. Property disallowedRequisites
Title: Disallowed Requisites
Description: The output's closure must not contain any paths in this list.
| 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 |
| drvRef | - |
1.1.1.7.1. drvRef
1.2. Property Output Checks Per Output
Title: Output Checks Per Output
| |
| Type | object |
| Required | No |
| Additional properties | Not allowed |
Description: Output checks specified individually for each output.
| Property | Type | Pattern | Title/Description |
| + perOutput | object | No | - |
1.2.1. Property perOutput
| Property | Type | Pattern | Title/Description |
| - | object | No | Output Check Specification |
1.2.1.1. Property Output Check Specification
Title: Output Check Specification
| |
| Type | object |
| Required | No |
| Additional properties | Not allowed |
| Same definition as | forAllOutputs |
Description: Constraints on what a specific output can reference.
2. Property unsafeDiscardReferences
Title: Unsafe Discard References
Description: A map specifying which references should be unsafely discarded from each output.
This is generally not recommended and requires special permissions.
| Property | Type | Pattern | Title/Description |
| - | array of string | No | - |
2.1. Property additionalProperties
| |
| Type | array of string |
| Required | No |
| Array restrictions |
| Min items | N/A |
| Max items | N/A |
| Items unicity | False |
| Additional items | False |
| Tuple validation | See below |
2.1.1. additionalProperties items
3. Property passAsFile
Title: Pass As File
| |
| Type | array of string |
| Required | Yes |
Description: List of environment variable names whose values should be passed as files rather than directly.
| Array restrictions |
| Min items | N/A |
| Max items | N/A |
| Items unicity | False |
| Additional items | False |
| Tuple validation | See below |
3.1. passAsFile items
4. Property exportReferencesGraph
Title: Export References Graph
Description: Specify paths whose references graph should be exported to files.
| Property | Type | Pattern | Title/Description |
| - | array | No | - |
4.1. Property additionalProperties
| Array restrictions |
| Min items | N/A |
| Max items | N/A |
| Items unicity | False |
| Additional items | False |
| Tuple validation | See below |
4.1.1. Deriving Path
Title: Deriving Path
| |
| Type | combining |
| Required | No |
| Additional properties | Any type allowed |
| Same definition as | Deriving Path |
Description: This schema describes the JSON representation of Nix's Deriving Path.
5. Property additionalSandboxProfile
Title: Additional Sandbox Profile
Description: Additional sandbox profile directives (macOS specific).
6. Property noChroot
Title: No Chroot
Description: Whether to disable the build sandbox, if allowed.
7. Property impureHostDeps
Title: Impure Host Dependencies
| |
| Type | array of string |
| Required | Yes |
Description: List of host paths that the build can access.
| Array restrictions |
| Min items | N/A |
| Max items | N/A |
| Items unicity | False |
| Additional items | False |
| Tuple validation | See below |
7.1. impureHostDeps items
8. Property impureEnvVars
Title: Impure Environment Variables
| |
| Type | array of string |
| Required | Yes |
Description: List of environment variable names that should be passed through to the build from the calling environment.
| Array restrictions |
| Min items | N/A |
| Max items | N/A |
| Items unicity | False |
| Additional items | False |
| Tuple validation | See below |
8.1. impureEnvVars items
9. Property allowLocalNetworking
Title: Allow Local Networking
Description: Whether the build should have access to local network (macOS specific).
10. Property requiredSystemFeatures
Title: Required System Features
| |
| Type | array of string |
| Required | Yes |
Description: List of system features required to build this derivation (e.g., "kvm", "nixos-test").
| Array restrictions |
| Min items | N/A |
| Max items | N/A |
| Items unicity | False |
| Additional items | False |
| Tuple validation | See below |
10.1. requiredSystemFeatures items
11. Property preferLocalBuild
Title: Prefer Local Build
Description: Whether this derivation should preferably be built locally rather than its outputs substituted.
12. Property allowSubstitutes
Title: Allow Substitutes
Description: Whether substituting from other stores should be allowed for this derivation's outputs.
{
"additionalSandboxProfile": "",
"allowLocalNetworking": false,
"allowSubstitutes": true,
"exportReferencesGraph": {},
"impureEnvVars": [],
"impureHostDeps": [],
"noChroot": false,
"outputChecks": {
"forAllOutputs": {
"allowedReferences": null,
"allowedRequisites": null,
"disallowedReferences": [],
"disallowedRequisites": [],
"ignoreSelfRefs": true,
"maxClosureSize": null,
"maxSize": null
}
},
"passAsFile": [],
"preferLocalBuild": false,
"requiredSystemFeatures": [],
"unsafeDiscardReferences": {}
}
{
"additionalSandboxProfile": "sandcastle",
"allowLocalNetworking": true,
"allowSubstitutes": false,
"exportReferencesGraph": {
"refs1": [
"p0hax2lzvjpfc2gwkk62xdglz0fcqfzn-foo"
],
"refs2": [
"vj2i49jm2868j2fmqvxm70vlzmzvgv14-bar.drv"
]
},
"impureEnvVars": [
"UNICORN"
],
"impureHostDeps": [
"/usr/bin/ditto"
],
"noChroot": true,
"outputChecks": {
"forAllOutputs": {
"allowedReferences": [
"p0hax2lzvjpfc2gwkk62xdglz0fcqfzn-foo"
],
"allowedRequisites": [
{
"drvPath": "self",
"output": "bin"
},
"z0rjzy29v9k5qa4nqpykrbzirj7sd43v-foo-dev"
],
"disallowedReferences": [
{
"drvPath": "self",
"output": "dev"
},
"r5cff30838majxk5mp3ip2diffi8vpaj-bar"
],
"disallowedRequisites": [
"9b61w26b4avv870dw0ymb6rw4r1hzpws-bar-dev"
],
"ignoreSelfRefs": true,
"maxClosureSize": null,
"maxSize": null
}
},
"passAsFile": [],
"preferLocalBuild": true,
"requiredSystemFeatures": [
"rainbow",
"uid-range"
],
"unsafeDiscardReferences": {}
}
{
"additionalSandboxProfile": "",
"allowLocalNetworking": false,
"allowSubstitutes": true,
"exportReferencesGraph": {},
"impureEnvVars": [],
"impureHostDeps": [],
"noChroot": false,
"outputChecks": {
"perOutput": {}
},
"passAsFile": [],
"preferLocalBuild": false,
"requiredSystemFeatures": [],
"unsafeDiscardReferences": {}
}
{
"additionalSandboxProfile": "sandcastle",
"allowLocalNetworking": true,
"allowSubstitutes": false,
"exportReferencesGraph": {
"refs1": [
"p0hax2lzvjpfc2gwkk62xdglz0fcqfzn-foo"
],
"refs2": [
"vj2i49jm2868j2fmqvxm70vlzmzvgv14-bar.drv"
]
},
"impureEnvVars": [
"UNICORN"
],
"impureHostDeps": [
"/usr/bin/ditto"
],
"noChroot": true,
"outputChecks": {
"perOutput": {
"bin": {
"allowedReferences": null,
"allowedRequisites": null,
"disallowedReferences": [
{
"drvPath": "self",
"output": "dev"
},
"r5cff30838majxk5mp3ip2diffi8vpaj-bar"
],
"disallowedRequisites": [
"9b61w26b4avv870dw0ymb6rw4r1hzpws-bar-dev"
],
"ignoreSelfRefs": false,
"maxClosureSize": null,
"maxSize": null
},
"dev": {
"allowedReferences": null,
"allowedRequisites": null,
"disallowedReferences": [],
"disallowedRequisites": [],
"ignoreSelfRefs": false,
"maxClosureSize": 5909,
"maxSize": 789
},
"out": {
"allowedReferences": [
"p0hax2lzvjpfc2gwkk62xdglz0fcqfzn-foo"
],
"allowedRequisites": [
{
"drvPath": "self",
"output": "bin"
},
"z0rjzy29v9k5qa4nqpykrbzirj7sd43v-foo-dev"
],
"disallowedReferences": [],
"disallowedRequisites": [],
"ignoreSelfRefs": false,
"maxClosureSize": null,
"maxSize": null
}
}
},
"passAsFile": [],
"preferLocalBuild": true,
"requiredSystemFeatures": [
"rainbow",
"uid-range"
],
"unsafeDiscardReferences": {}
}
{
"additionalSandboxProfile": "sandcastle",
"allowLocalNetworking": true,
"allowSubstitutes": false,
"exportReferencesGraph": {
"refs1": [
{
"drvPath": "j56sf12rxpcv5swr14vsjn5cwm6bj03h-foo.drv",
"output": "out"
}
],
"refs2": [
"qnml92yh97a6fbrs2m5qg5cqlc8vni58-bar.drv"
]
},
"impureEnvVars": [
"UNICORN"
],
"impureHostDeps": [
"/usr/bin/ditto"
],
"noChroot": true,
"outputChecks": {
"forAllOutputs": {
"allowedReferences": [
{
"drvPath": "j56sf12rxpcv5swr14vsjn5cwm6bj03h-foo.drv",
"output": "out"
}
],
"allowedRequisites": [
{
"drvPath": "self",
"output": "bin"
},
{
"drvPath": "j56sf12rxpcv5swr14vsjn5cwm6bj03h-foo.drv",
"output": "dev"
}
],
"disallowedReferences": [
{
"drvPath": "self",
"output": "dev"
},
{
"drvPath": "qnml92yh97a6fbrs2m5qg5cqlc8vni58-bar.drv",
"output": "out"
}
],
"disallowedRequisites": [
{
"drvPath": "qnml92yh97a6fbrs2m5qg5cqlc8vni58-bar.drv",
"output": "dev"
}
],
"ignoreSelfRefs": true,
"maxClosureSize": null,
"maxSize": null
}
},
"passAsFile": [],
"preferLocalBuild": true,
"requiredSystemFeatures": [
"rainbow",
"uid-range"
],
"unsafeDiscardReferences": {}
}
{
"additionalSandboxProfile": "sandcastle",
"allowLocalNetworking": true,
"allowSubstitutes": false,
"exportReferencesGraph": {
"refs1": [
{
"drvPath": "j56sf12rxpcv5swr14vsjn5cwm6bj03h-foo.drv",
"output": "out"
}
],
"refs2": [
"qnml92yh97a6fbrs2m5qg5cqlc8vni58-bar.drv"
]
},
"impureEnvVars": [
"UNICORN"
],
"impureHostDeps": [
"/usr/bin/ditto"
],
"noChroot": true,
"outputChecks": {
"perOutput": {
"bin": {
"allowedReferences": null,
"allowedRequisites": null,
"disallowedReferences": [
{
"drvPath": "self",
"output": "dev"
},
{
"drvPath": "qnml92yh97a6fbrs2m5qg5cqlc8vni58-bar.drv",
"output": "out"
}
],
"disallowedRequisites": [
{
"drvPath": "qnml92yh97a6fbrs2m5qg5cqlc8vni58-bar.drv",
"output": "dev"
}
],
"ignoreSelfRefs": false,
"maxClosureSize": null,
"maxSize": null
},
"dev": {
"allowedReferences": null,
"allowedRequisites": null,
"disallowedReferences": [],
"disallowedRequisites": [],
"ignoreSelfRefs": false,
"maxClosureSize": 5909,
"maxSize": 789
},
"out": {
"allowedReferences": [
{
"drvPath": "j56sf12rxpcv5swr14vsjn5cwm6bj03h-foo.drv",
"output": "out"
}
],
"allowedRequisites": [
{
"drvPath": "self",
"output": "bin"
},
{
"drvPath": "j56sf12rxpcv5swr14vsjn5cwm6bj03h-foo.drv",
"output": "dev"
}
],
"disallowedReferences": [],
"disallowedRequisites": [],
"ignoreSelfRefs": false,
"maxClosureSize": null,
"maxSize": null
}
}
},
"passAsFile": [],
"preferLocalBuild": true,
"requiredSystemFeatures": [
"rainbow",
"uid-range"
],
"unsafeDiscardReferences": {}
}