1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

Add titles in JSON schemas

This way, the description isn't rendered in the tables of contents,
leading to no more formatting errors.
This commit is contained in:
Robert Hensing 2025-10-17 21:50:31 +02:00
parent 01b001d5ba
commit c92ba4b9b7
2 changed files with 15 additions and 0 deletions

View file

@ -26,12 +26,14 @@ required:
properties: properties:
name: name:
type: string type: string
title: Derivation name
description: | description: |
The name of the derivation. The name of the derivation.
Used when calculating store paths for the derivations outputs. Used when calculating store paths for the derivations outputs.
version: version:
const: 3 const: 3
title: Format version (must be 3)
description: | description: |
Must be `3`. Must be `3`.
This is a guard that allows us to continue evolving this format. This is a guard that allows us to continue evolving this format.
@ -49,6 +51,7 @@ properties:
outputs: outputs:
type: object type: object
title: Output specifications
description: | description: |
Information about the output paths of the derivation. 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. 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.
@ -69,6 +72,7 @@ properties:
inputSrcs: inputSrcs:
type: array type: array
title: Input source paths
description: | description: |
List of store paths on which this derivation depends. List of store paths on which this derivation depends.
@ -85,6 +89,7 @@ properties:
inputDrvs: inputDrvs:
type: object type: object
title: Input derivations
description: | description: |
Mapping of derivation paths to lists of output names they provide. Mapping of derivation paths to lists of output names they provide.
@ -101,12 +106,14 @@ properties:
system: system:
type: string type: string
title: Build system type
description: | description: |
The system type on which this derivation is to be built The system type on which this derivation is to be built
(e.g. `x86_64-linux`). (e.g. `x86_64-linux`).
builder: builder:
type: string type: string
title: Build program path
description: | description: |
Absolute path of the program used to perform the build. Absolute path of the program used to perform the build.
Typically this is the `bash` shell Typically this is the `bash` shell
@ -114,6 +121,7 @@ properties:
args: args:
type: array type: array
title: Builder arguments
description: | description: |
Command-line arguments passed to the `builder`. Command-line arguments passed to the `builder`.
items: items:
@ -121,12 +129,14 @@ properties:
env: env:
type: object type: object
title: Environment variables
description: | description: |
Environment variables passed to the `builder`. Environment variables passed to the `builder`.
additionalProperties: additionalProperties:
type: string type: string
structuredAttrs: structuredAttrs:
title: Structured attributes
description: | description: |
[Structured Attributes](@docroot@/store/derivation/index.md#structured-attrs), only defined if the derivation contains them. [Structured Attributes](@docroot@/store/derivation/index.md#structured-attrs), only defined if the derivation contains them.
Structured attributes are JSON, and thus embedded as-is. Structured attributes are JSON, and thus embedded as-is.
@ -139,11 +149,13 @@ properties:
properties: properties:
path: path:
type: string type: string
title: Output path
description: | description: |
The output path, if known in advance. The output path, if known in advance.
method: method:
type: string type: string
title: Content addressing method
enum: [flat, nar, text, git] enum: [flat, nar, text, git]
description: | description: |
For an output which will be [content addressed](@docroot@/store/derivation/outputs/content-address.md), a string representing the [method](@docroot@/store/store-object/content-address.md) of content addressing that is chosen. For an output which will be [content addressed](@docroot@/store/derivation/outputs/content-address.md), a string representing the [method](@docroot@/store/store-object/content-address.md) of content addressing that is chosen.
@ -156,9 +168,11 @@ properties:
- [`git`](@docroot@/store/store-object/content-address.md#method-git) - [`git`](@docroot@/store/store-object/content-address.md#method-git)
hashAlgo: hashAlgo:
title: Hash algorithm
"$ref": "./hash-v1.yaml#/$defs/algorithm" "$ref": "./hash-v1.yaml#/$defs/algorithm"
hash: hash:
type: string type: string
title: Expected hash value
description: | description: |
For fixed-output derivations, the expected content hash in base-16. For fixed-output derivations, the expected content hash in base-16.

View file

@ -10,6 +10,7 @@ description: |
type: object type: object
properties: properties:
algorithm: algorithm:
title: Hash algorithm
"$ref": "#/$defs/algorithm" "$ref": "#/$defs/algorithm"
required: required:
- algorithm - algorithm