nixos/tasks: invariant option docs MD conversions

This commit is contained in:
pennae 2022-07-19 15:05:45 +02:00
parent 860a0449ce
commit b115622f4b
3 changed files with 20 additions and 20 deletions

View File

@ -16,33 +16,33 @@ let
enable = mkOption { enable = mkOption {
default = false; default = false;
type = types.bool; type = types.bool;
description = "The block device is backed by an encrypted one, adds this device as a initrd luks entry."; description = lib.mdDoc "The block device is backed by an encrypted one, adds this device as a initrd luks entry.";
}; };
blkDev = mkOption { blkDev = mkOption {
default = null; default = null;
example = "/dev/sda1"; example = "/dev/sda1";
type = types.nullOr types.str; type = types.nullOr types.str;
description = "Location of the backing encrypted device."; description = lib.mdDoc "Location of the backing encrypted device.";
}; };
label = mkOption { label = mkOption {
default = null; default = null;
example = "rootfs"; example = "rootfs";
type = types.nullOr types.str; type = types.nullOr types.str;
description = "Label of the unlocked encrypted device. Set <literal>fileSystems.&lt;name?&gt;.device</literal> to <literal>/dev/mapper/&lt;label&gt;</literal> to mount the unlocked device."; description = lib.mdDoc "Label of the unlocked encrypted device. Set `fileSystems.<name?>.device` to `/dev/mapper/<label>` to mount the unlocked device.";
}; };
keyFile = mkOption { keyFile = mkOption {
default = null; default = null;
example = "/mnt-root/root/.swapkey"; example = "/mnt-root/root/.swapkey";
type = types.nullOr types.str; type = types.nullOr types.str;
description = '' description = lib.mdDoc ''
Path to a keyfile used to unlock the backing encrypted Path to a keyfile used to unlock the backing encrypted
device. At the time this keyfile is accessed, the device. At the time this keyfile is accessed, the
<literal>neededForBoot</literal> filesystems (see `neededForBoot` filesystems (see
<literal>fileSystems.&lt;name?&gt;.neededForBoot</literal>) `fileSystems.<name?>.neededForBoot`)
will have been mounted under <literal>/mnt-root</literal>, will have been mounted under `/mnt-root`,
so the keyfile path should usually start with "/mnt-root/". so the keyfile path should usually start with "/mnt-root/".
''; '';
}; };

View File

@ -14,7 +14,7 @@ in
d2 = "/mnt/disk2/"; d2 = "/mnt/disk2/";
d3 = "/mnt/disk3/"; d3 = "/mnt/disk3/";
}; };
description = "SnapRAID data disks."; description = lib.mdDoc "SnapRAID data disks.";
type = attrsOf str; type = attrsOf str;
}; };
parityFiles = mkOption { parityFiles = mkOption {
@ -27,7 +27,7 @@ in
"/mnt/diskt/snapraid.5-parity" "/mnt/diskt/snapraid.5-parity"
"/mnt/disku/snapraid.6-parity" "/mnt/disku/snapraid.6-parity"
]; ];
description = "SnapRAID parity files."; description = lib.mdDoc "SnapRAID parity files.";
type = listOf str; type = listOf str;
}; };
contentFiles = mkOption { contentFiles = mkOption {
@ -37,46 +37,46 @@ in
"/mnt/disk1/snapraid.content" "/mnt/disk1/snapraid.content"
"/mnt/disk2/snapraid.content" "/mnt/disk2/snapraid.content"
]; ];
description = "SnapRAID content list files."; description = lib.mdDoc "SnapRAID content list files.";
type = listOf str; type = listOf str;
}; };
exclude = mkOption { exclude = mkOption {
default = [ ]; default = [ ];
example = [ "*.unrecoverable" "/tmp/" "/lost+found/" ]; example = [ "*.unrecoverable" "/tmp/" "/lost+found/" ];
description = "SnapRAID exclude directives."; description = lib.mdDoc "SnapRAID exclude directives.";
type = listOf str; type = listOf str;
}; };
touchBeforeSync = mkOption { touchBeforeSync = mkOption {
default = true; default = true;
example = false; example = false;
description = description = lib.mdDoc
"Whether <command>snapraid touch</command> should be run before <command>snapraid sync</command>."; "Whether {command}`snapraid touch` should be run before {command}`snapraid sync`.";
type = bool; type = bool;
}; };
sync.interval = mkOption { sync.interval = mkOption {
default = "01:00"; default = "01:00";
example = "daily"; example = "daily";
description = "How often to run <command>snapraid sync</command>."; description = lib.mdDoc "How often to run {command}`snapraid sync`.";
type = str; type = str;
}; };
scrub = { scrub = {
interval = mkOption { interval = mkOption {
default = "Mon *-*-* 02:00:00"; default = "Mon *-*-* 02:00:00";
example = "weekly"; example = "weekly";
description = "How often to run <command>snapraid scrub</command>."; description = lib.mdDoc "How often to run {command}`snapraid scrub`.";
type = str; type = str;
}; };
plan = mkOption { plan = mkOption {
default = 8; default = 8;
example = 5; example = 5;
description = description = lib.mdDoc
"Percent of the array that should be checked by <command>snapraid scrub</command>."; "Percent of the array that should be checked by {command}`snapraid scrub`.";
type = int; type = int;
}; };
olderThan = mkOption { olderThan = mkOption {
default = 10; default = 10;
example = 20; example = 20;
description = description = lib.mdDoc
"Number of days since data was last scrubbed before it can be scrubbed again."; "Number of days since data was last scrubbed before it can be scrubbed again.";
type = int; type = int;
}; };
@ -90,7 +90,7 @@ in
autosave 500 autosave 500
pool /pool pool /pool
''; '';
description = "Extra config options for SnapRAID."; description = lib.mdDoc "Extra config options for SnapRAID.";
type = lines; type = lines;
}; };
}; };

View File

@ -10,7 +10,7 @@ in {
}; };
mdadmConf = lib.mkOption { mdadmConf = lib.mkOption {
description = "Contents of <filename>/etc/mdadm.conf</filename> in initrd."; description = lib.mdDoc "Contents of {file}`/etc/mdadm.conf` in initrd.";
type = lib.types.lines; type = lib.types.lines;
default = ""; default = "";
}; };