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:
pennae 2022-07-28 23:19:15 +02:00
parent 52b0ad17e3
commit 2e751c0772
1050 changed files with 9605 additions and 9605 deletions

View file

@ -76,8 +76,8 @@ in {
startAt = mkOption {
default = "*-*-* 01:15:00";
type = with types; either (listOf str) str;
description = ''
This option defines (see <literal>systemd.time</literal> for format) when the
description = lib.mdDoc ''
This option defines (see `systemd.time` for format) when the
databases should be dumped.
The default is to update at 01:15 (at night) every day.
'';
@ -87,10 +87,10 @@ in {
default = cfg.databases == [];
defaultText = literalExpression "services.postgresqlBackup.databases == []";
type = lib.types.bool;
description = ''
description = lib.mdDoc ''
Backup all databases using pg_dumpall.
This option is mutual exclusive to
<literal>services.postgresqlBackup.databases</literal>.
`services.postgresqlBackup.databases`.
The resulting backup dump will have the name all.sql.gz.
This option is the default if no databases are specified.
'';
@ -99,7 +99,7 @@ in {
databases = mkOption {
default = [];
type = types.listOf types.str;
description = ''
description = lib.mdDoc ''
List of database names to dump.
'';
};
@ -107,7 +107,7 @@ in {
location = mkOption {
default = "/var/backup/postgresql";
type = types.path;
description = ''
description = lib.mdDoc ''
Path of directory where the PostgreSQL database dumps will be placed.
'';
};
@ -115,9 +115,9 @@ in {
pgdumpOptions = mkOption {
type = types.separatedString " ";
default = "-C";
description = ''
description = lib.mdDoc ''
Command line options for pg_dump. This options is not used
if <literal>config.services.postgresqlBackup.backupAll</literal> is enabled.
if `config.services.postgresqlBackup.backupAll` is enabled.
Note that config.services.postgresqlBackup.backupAll is also active,
when no databases where specified.
'';
@ -126,7 +126,7 @@ in {
compression = mkOption {
type = types.enum ["none" "gzip" "zstd"];
default = "gzip";
description = ''
description = lib.mdDoc ''
The type of compression to use on the generated database dump.
'';
};
@ -134,7 +134,7 @@ in {
compressionLevel = mkOption {
type = types.ints.between 1 19;
default = 6;
description = ''
description = lib.mdDoc ''
The compression level used when compression is enabled.
gzip accepts levels 1 to 9. zstd accepts levels 1 to 19.
'';