Run formatter

This commit is contained in:
pinpox
2025-08-25 18:40:51 +02:00
parent a9c53b8b1e
commit 41c52197ea
71 changed files with 2118 additions and 1379 deletions

View File

@@ -1,9 +1,9 @@
!!! Danger ":fontawesome-solid-road-barrier: Under Construction
:fontawesome-solid-road-barrier:" Currently under construction use with caution
!!! Danger ":fontawesome-solid-road-barrier: Under Construction :fontawesome-solid-road-barrier:"
Currently under construction use with caution
:fontawesome-solid-road-barrier: :fontawesome-solid-road-barrier: :fontawesome-solid-road-barrier:
```
:fontawesome-solid-road-barrier: :fontawesome-solid-road-barrier: :fontawesome-solid-road-barrier:
```
## Structure
@@ -20,13 +20,16 @@ A disk template consists of exactly two files
## `default.nix`
Placeholders are filled with their machine specific options when a template is used for a machine.
Placeholders are filled with their machine specific options when a template is
used for a machine.
The user can choose any valid options from the hardware report.
The file itself is then copied to `machines/{machineName}/disko.nix` and will be automatically loaded by the machine.
The file itself is then copied to `machines/{machineName}/disko.nix` and will be
automatically loaded by the machine.
`single-disk/default.nix`
```
{
disko.devices = {
@@ -42,9 +45,11 @@ The file itself is then copied to `machines/{machineName}/disko.nix` and will be
## Placeholders
Each template must declare the options of its placeholders depending on the hardware-report.
Each template must declare the options of its placeholders depending on the
hardware-report.
`api/disk.py`
```py
templates: dict[str, dict[str, Callable[[dict[str, Any]], Placeholder]]] = {
"single-disk": {
@@ -56,24 +61,25 @@ templates: dict[str, dict[str, Callable[[dict[str, Any]], Placeholder]]] = {
}
```
Introducing new local or global placeholders requires contributing to clan-core `api/disks.py`.
Introducing new local or global placeholders requires contributing to clan-core
`api/disks.py`.
### Predefined placeholders
Some placeholders provide predefined functionality
- `uuid`: In most cases we recommend adding a unique id to all disks. This prevents the system to false boot from i.e. hot-plugged devices.
```
disko.devices = {
disk = {
main = {
name = "main-{{uuid}}";
...
}
- `uuid`: In most cases we recommend adding a unique id to all disks. This
prevents the system to false boot from i.e. hot-plugged devices.
```
disko.devices = {
disk = {
main = {
name = "main-{{uuid}}";
...
}
}
```
}
```
## Readme
@@ -90,5 +96,5 @@ Use this schema for simple setups where ....
```
The format and fields of this file is not clear yet. We might change that once fully implemented.
The format and fields of this file is not clear yet. We might change that once
fully implemented.