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

@ -88,9 +88,9 @@ in
defaultText = ''
A configuration file automatically generated by NixOS.
'';
description = ''
description = lib.mdDoc ''
Override the configuration file used by MySQL. By default,
NixOS generates one automatically from <option>services.mysql.settings</option>.
NixOS generates one automatically from {option}`services.mysql.settings`.
'';
example = literalExpression ''
pkgs.writeText "my.cnf" '''
@ -143,14 +143,14 @@ in
options = {
name = mkOption {
type = types.str;
description = ''
description = lib.mdDoc ''
The name of the database to create.
'';
};
schema = mkOption {
type = types.nullOr types.path;
default = null;
description = ''
description = lib.mdDoc ''
The initial schema of the database; if null (the default),
an empty database is created.
'';
@ -158,7 +158,7 @@ in
};
});
default = [];
description = ''
description = lib.mdDoc ''
List of database names and their initial schemas that should be used to create databases on the first startup
of MySQL. The schema attribute is optional: If not specified, an empty database is created.
'';
@ -171,13 +171,13 @@ in
initialScript = mkOption {
type = types.nullOr types.path;
default = null;
description = "A file containing SQL statements to be executed on the first startup. Can be used for granting certain permissions on the database.";
description = lib.mdDoc "A file containing SQL statements to be executed on the first startup. Can be used for granting certain permissions on the database.";
};
ensureDatabases = mkOption {
type = types.listOf types.str;
default = [];
description = ''
description = lib.mdDoc ''
Ensures that the specified databases exist.
This option will never delete existing databases, especially not when the value of this
option is changed. This means that databases created once through this option or
@ -194,7 +194,7 @@ in
options = {
name = mkOption {
type = types.str;
description = ''
description = lib.mdDoc ''
Name of the user to ensure.
'';
};
@ -223,7 +223,7 @@ in
};
});
default = [];
description = ''
description = lib.mdDoc ''
Ensures that the specified users exist and have at least the ensured permissions.
The MySQL users will be identified using Unix socket authentication. This authenticates the Unix user with the
same name only, and that without the need for a password.
@ -253,39 +253,39 @@ in
role = mkOption {
type = types.enum [ "master" "slave" "none" ];
default = "none";
description = "Role of the MySQL server instance.";
description = lib.mdDoc "Role of the MySQL server instance.";
};
serverId = mkOption {
type = types.int;
default = 1;
description = "Id of the MySQL server instance. This number must be unique for each instance.";
description = lib.mdDoc "Id of the MySQL server instance. This number must be unique for each instance.";
};
masterHost = mkOption {
type = types.str;
description = "Hostname of the MySQL master server.";
description = lib.mdDoc "Hostname of the MySQL master server.";
};
slaveHost = mkOption {
type = types.str;
description = "Hostname of the MySQL slave server.";
description = lib.mdDoc "Hostname of the MySQL slave server.";
};
masterUser = mkOption {
type = types.str;
description = "Username of the MySQL replication user.";
description = lib.mdDoc "Username of the MySQL replication user.";
};
masterPassword = mkOption {
type = types.str;
description = "Password of the MySQL replication user.";
description = lib.mdDoc "Password of the MySQL replication user.";
};
masterPort = mkOption {
type = types.port;
default = 3306;
description = "Port number on which the MySQL master server runs.";
description = lib.mdDoc "Port number on which the MySQL master server runs.";
};
};
};