|
1 | 1 | { |
2 | | - "$id": "https://raw.githubusercontent.com/DeterminateSystems/bootspec/v1.0.0/schema.json", |
| 2 | + "$id": "https://raw.githubusercontent.com/DeterminateSystems/bootspec/main/schema.json", |
3 | 3 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
4 | 4 | "title": "NixOS bootspec v1 schema", |
5 | 5 | "description": "Bootspec is a set of memoized facts about a system's closure. The top-level object may contain arbitrary further keys (\"extensions\") whose semantics may be defined by third parties. The use of reverse-domain-name namespacing is recommended in order to avoid name collisions.", |
6 | 6 | "type": "object", |
7 | 7 | "required": ["org.nixos.bootspec.v1"], |
8 | 8 | "properties": { |
9 | | - "org.nixos.bootspec.v1": { "$ref": "#/$defs/Bootspec" }, |
| 9 | + "org.nixos.bootspec.v1": { "$ref": "#/$defs/BootspecV1" }, |
10 | 10 | "org.nixos.specialisation.v1": { |
11 | 11 | "type": "object", |
12 | 12 | "patternProperties": { |
13 | 13 | "^.*$": { |
14 | 14 | "type": "object", |
15 | 15 | "properties": { |
16 | | - "org.nixos.bootspec.v1": { "$ref": "#/$defs/Bootspec" } |
| 16 | + "org.nixos.bootspec.v1": { "$ref": "#/$defs/BootspecV1" } |
17 | 17 | }, |
18 | 18 | "required": ["org.nixos.bootspec.v1"], |
19 | 19 | "additionalProperties": true |
|
23 | 23 | }, |
24 | 24 | "patternProperties": { |
25 | 25 | "^.*$": { |
26 | | - "$ref": "#/$defs/Bootspec", |
27 | | - "description": "Testing" |
| 26 | + "description": "Additional top-level specialisations" |
28 | 27 | } |
29 | 28 | }, |
30 | 29 | "$defs": { |
31 | | - "Bootspec": { |
| 30 | + "BootspecV1": { |
32 | 31 | "type": "object", |
33 | 32 | "required": ["init", "kernel", "kernelParams", "label", "system", "toplevel"], |
34 | 33 | "properties": { |
35 | 34 | "init": { |
36 | | - "type": "string", |
| 35 | + "allOf": [ |
| 36 | + { "$ref": "#/$defs/NixStorePath" } |
| 37 | + ], |
37 | 38 | "description": "Nix store path to the stage-2 init, executed by initrd (if present)." |
38 | 39 | }, |
39 | 40 | "kernel": { |
40 | | - "type": "string", |
| 41 | + "allOf": [ |
| 42 | + { "$ref": "#/$defs/NixStorePath" } |
| 43 | + ], |
41 | 44 | "description": "Nix store path to the kernel image." |
42 | 45 | }, |
43 | 46 | "kernelParams": { |
44 | 47 | "type": "array", |
45 | | - "items": { |
46 | | - "type": "string" |
47 | | - }, |
48 | | - "description": "Kernel command line options.", |
| 48 | + "items": { "$ref": "#/$defs/KernelParameter" }, |
| 49 | + "description": "List of kernel parameters", |
49 | 50 | "examples": [ |
50 | 51 | [ |
51 | | - "amd_iommu=on", |
52 | | - "amd_iommu=pt", |
53 | | - "iommu=pt", |
54 | | - "kvm.ignore_msrs=1", |
55 | | - "kvm.report_ignored_msrs=0", |
56 | | - "udev.log_priority=3", |
57 | | - "systemd.unified_cgroup_hierarchy=1", |
58 | | - "loglevel=4" |
| 52 | + "amd_iommu=on", |
| 53 | + "amd_iommu=pt", |
| 54 | + "iommu=pt", |
| 55 | + "kvm.ignore_msrs=1", |
| 56 | + "kvm.report_ignored_msrs=0", |
| 57 | + "udev.log_priority=3", |
| 58 | + "systemd.unified_cgroup_hierarchy=1", |
| 59 | + "loglevel=4" |
59 | 60 | ] |
60 | 61 | ] |
61 | 62 | }, |
|
70 | 71 | "examples": ["x86_64-linux", "aarch64-linux"] |
71 | 72 | }, |
72 | 73 | "toplevel": { |
73 | | - "type": "string", |
| 74 | + "allOf": [ |
| 75 | + { "$ref": "#/$defs/NixStorePath" } |
| 76 | + ], |
74 | 77 | "description": "Top-level Nix store path of the system closure." |
75 | 78 | }, |
76 | 79 | "initrd": { |
77 | | - "type": "string", |
| 80 | + "allOf": [ |
| 81 | + { "$ref": "#/$defs/NixStorePath" } |
| 82 | + ], |
78 | 83 | "description": "Nix store path to the initrd." |
79 | 84 | }, |
80 | 85 | "initrdSecrets": { |
81 | | - "type": "string", |
| 86 | + "allOf": [ |
| 87 | + { "$ref": "#/$defs/NixStorePath" } |
| 88 | + ], |
82 | 89 | "description": "Nix store path to a tool that dynamically adds secrets to initrd. Consumers of a bootspec document should copy the file referenced by the `initrd` key to a writable location, ensure that the file is writable, invoke this tool with the path to the initrd as its only argument, and use the initrd as modified by the tool for booting. This may be used to add files from outside the Nix store to the initrd. This tool is expected to run on the system whose boot specification is being set up, and may thus fail if used on a system where the expected stateful files are not in place or whose CPU does not support the instruction set of the system to be booted. If this field is present and the tool fails, no boot configuration should be generated for the system." |
83 | 90 | } |
84 | 91 | } |
| 92 | + }, |
| 93 | + "KernelParameter": { |
| 94 | + "type": "string", |
| 95 | + "pattern": "^[a-zA-Z0-9._-]+(=[^\\s=]+)?$", |
| 96 | + "description": "A kernel parameter in the form key[=value], e.g., loglevel=4 or quiet" |
| 97 | + }, |
| 98 | + "NixStorePath": { |
| 99 | + "type": "string", |
| 100 | + "description": "A valid Nix store path" |
85 | 101 | } |
86 | 102 | } |
87 | 103 | } |
0 commit comments