treewide: automatically md-convert option descriptions
the conversion procedure is simple: - find all things that look like options, ie calls to either `mkOption` or `lib.mkOption` that take an attrset. remember the attrset as the option - for all options, find a `description` attribute who's value is not a call to `mdDoc` or `lib.mdDoc` - textually convert the entire value of the attribute to MD with a few simple regexes (the set from mdize-module.sh) - if the change produced a change in the manual output, discard - if the change kept the manual unchanged, add some text to the description to make sure we've actually found an option. if the manual changes this time, keep the converted description this procedure converts 80% of nixos options to markdown. around 2000 options remain to be inspected, but most of those fail the "does not change the manual output check": currently the MD conversion process does not faithfully convert docbook tags like <code> and <package>, so any option using such tags will not be converted at all.
This commit is contained in:
@@ -29,7 +29,7 @@ let
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
description = lib.mdDoc ''
|
||||
Allows libvirtd to take advantage of OVMF when creating new
|
||||
QEMU VMs with UEFI boot.
|
||||
'';
|
||||
@@ -47,7 +47,7 @@ let
|
||||
default = [ pkgs.OVMF.fd ];
|
||||
defaultText = literalExpression "[ pkgs.OVMF.fd ]";
|
||||
example = literalExpression "[ pkgs.OVMFFull.fd pkgs.pkgsCross.aarch64-multiplatform.OVMF.fd ]";
|
||||
description = ''
|
||||
description = lib.mdDoc ''
|
||||
List of OVMF packages to use. Each listed package must contain files names FV/OVMF_CODE.fd and FV/OVMF_VARS.fd or FV/AAVMF_CODE.fd and FV/AAVMF_VARS.fd
|
||||
'';
|
||||
};
|
||||
@@ -59,7 +59,7 @@ let
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
description = lib.mdDoc ''
|
||||
Allows libvirtd to use swtpm to create an emulated TPM.
|
||||
'';
|
||||
};
|
||||
@@ -68,7 +68,7 @@ let
|
||||
type = types.package;
|
||||
default = pkgs.swtpm;
|
||||
defaultText = literalExpression "pkgs.swtpm";
|
||||
description = ''
|
||||
description = lib.mdDoc ''
|
||||
swtpm package to use.
|
||||
'';
|
||||
};
|
||||
@@ -91,7 +91,7 @@ let
|
||||
runAsRoot = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
description = lib.mdDoc ''
|
||||
If true, libvirtd runs qemu as root.
|
||||
If false, libvirtd runs qemu as unprivileged user qemu-libvirtd.
|
||||
Changing this option to false may cause file permission issues
|
||||
@@ -105,7 +105,7 @@ let
|
||||
default = ''
|
||||
namespaces = []
|
||||
'';
|
||||
description = ''
|
||||
description = lib.mdDoc ''
|
||||
Contents written to the qemu configuration file, qemu.conf.
|
||||
Make sure to include a proper namespace configuration when
|
||||
supplying custom configuration.
|
||||
@@ -115,7 +115,7 @@ let
|
||||
ovmf = mkOption {
|
||||
type = ovmfModule;
|
||||
default = { };
|
||||
description = ''
|
||||
description = lib.mdDoc ''
|
||||
QEMU's OVMF options.
|
||||
'';
|
||||
};
|
||||
@@ -123,7 +123,7 @@ let
|
||||
swtpm = mkOption {
|
||||
type = swtpmModule;
|
||||
default = { };
|
||||
description = ''
|
||||
description = lib.mdDoc ''
|
||||
QEMU's swtpm options.
|
||||
'';
|
||||
};
|
||||
@@ -162,11 +162,11 @@ in
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
description = lib.mdDoc ''
|
||||
This option enables libvirtd, a daemon that manages
|
||||
virtual machines. Users in the "libvirtd" group can interact with
|
||||
the daemon (e.g. to start or stop VMs) using the
|
||||
<command>virsh</command> command line tool, among others.
|
||||
{command}`virsh` command line tool, among others.
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -174,7 +174,7 @@ in
|
||||
type = types.package;
|
||||
default = pkgs.libvirt;
|
||||
defaultText = literalExpression "pkgs.libvirt";
|
||||
description = ''
|
||||
description = lib.mdDoc ''
|
||||
libvirt package to use.
|
||||
'';
|
||||
};
|
||||
@@ -182,7 +182,7 @@ in
|
||||
extraConfig = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description = ''
|
||||
description = lib.mdDoc ''
|
||||
Extra contents appended to the libvirtd configuration file,
|
||||
libvirtd.conf.
|
||||
'';
|
||||
@@ -192,7 +192,7 @@ in
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
example = [ "--verbose" ];
|
||||
description = ''
|
||||
description = lib.mdDoc ''
|
||||
Extra command line arguments passed to libvirtd on startup.
|
||||
'';
|
||||
};
|
||||
@@ -200,7 +200,7 @@ in
|
||||
onBoot = mkOption {
|
||||
type = types.enum [ "start" "ignore" ];
|
||||
default = "start";
|
||||
description = ''
|
||||
description = lib.mdDoc ''
|
||||
Specifies the action to be done to / on the guests when the host boots.
|
||||
The "start" option starts all guests that were running prior to shutdown
|
||||
regardless of their autostart settings. The "ignore" option will not
|
||||
@@ -212,7 +212,7 @@ in
|
||||
onShutdown = mkOption {
|
||||
type = types.enum [ "shutdown" "suspend" ];
|
||||
default = "suspend";
|
||||
description = ''
|
||||
description = lib.mdDoc ''
|
||||
When shutting down / restarting the host what method should
|
||||
be used to gracefully halt the guests. Setting to "shutdown"
|
||||
will cause an ACPI shutdown of each guest. "suspend" will
|
||||
@@ -223,7 +223,7 @@ in
|
||||
allowedBridges = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ "virbr0" ];
|
||||
description = ''
|
||||
description = lib.mdDoc ''
|
||||
List of bridge devices that can be used by qemu:///session
|
||||
'';
|
||||
};
|
||||
@@ -231,7 +231,7 @@ in
|
||||
qemu = mkOption {
|
||||
type = qemuModule;
|
||||
default = { };
|
||||
description = ''
|
||||
description = lib.mdDoc ''
|
||||
QEMU related options.
|
||||
'';
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user