-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathschema.json
More file actions
103 lines (103 loc) · 4.2 KB
/
schema.json
File metadata and controls
103 lines (103 loc) · 4.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{
"$id": "https://raw.githubusercontent.com/DeterminateSystems/bootspec/main/schema.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "NixOS bootspec v1 schema",
"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.",
"type": "object",
"required": ["org.nixos.bootspec.v1"],
"properties": {
"org.nixos.bootspec.v1": { "$ref": "#/$defs/BootspecV1" },
"org.nixos.specialisation.v1": {
"type": "object",
"patternProperties": {
"^.*$": {
"type": "object",
"properties": {
"org.nixos.bootspec.v1": { "$ref": "#/$defs/BootspecV1" }
},
"required": ["org.nixos.bootspec.v1"],
"additionalProperties": true
}
}
}
},
"patternProperties": {
"^.*$": {
"description": "Additional top-level specialisations"
}
},
"$defs": {
"BootspecV1": {
"type": "object",
"required": ["init", "kernel", "kernelParams", "label", "system", "toplevel"],
"properties": {
"init": {
"allOf": [
{ "$ref": "#/$defs/NixStorePath" }
],
"description": "Nix store path to the stage-2 init, executed by initrd (if present)."
},
"kernel": {
"allOf": [
{ "$ref": "#/$defs/NixStorePath" }
],
"description": "Nix store path to the kernel image."
},
"kernelParams": {
"type": "array",
"items": { "$ref": "#/$defs/KernelParameter" },
"description": "List of kernel parameters",
"examples": [
[
"amd_iommu=on",
"amd_iommu=pt",
"iommu=pt",
"kvm.ignore_msrs=1",
"kvm.report_ignored_msrs=0",
"udev.log_priority=3",
"systemd.unified_cgroup_hierarchy=1",
"loglevel=4"
]
]
},
"label": {
"type": "string",
"description": "A human-readable label for the system. It should contain the operating system, kernel version,and other user-relevant information to identify the system. This corresponds loosely to `config.system.nixos.label`.",
"examples": ["NixOS 21.11.20210810.dirty (Linux 5.15.30)"]
},
"system": {
"type": "string",
"description": "Nix system type the bootspec is intended for.",
"examples": ["x86_64-linux", "aarch64-linux"]
},
"toplevel": {
"allOf": [
{ "$ref": "#/$defs/NixStorePath" }
],
"description": "Top-level Nix store path of the system closure."
},
"initrd": {
"allOf": [
{ "$ref": "#/$defs/NixStorePath" }
],
"description": "Nix store path to the initrd."
},
"initrdSecrets": {
"allOf": [
{ "$ref": "#/$defs/NixStorePath" }
],
"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."
}
}
},
"KernelParameter": {
"type": "string",
"pattern": "^[a-zA-Z0-9._-]+(=[^\\s=]+)?$",
"description": "A kernel parameter in the form key[=value], e.g., loglevel=4 or quiet"
},
"NixStorePath": {
"type": "string",
"description": "A valid Nix store path"
}
}
}