0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 13:40:28 +03:00

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

@ -52,21 +52,21 @@ let
enable = mkOption {
type = types.nullOr types.bool;
default = null;
description = "Whether to run the rspamd worker.";
description = lib.mdDoc "Whether to run the rspamd worker.";
};
name = mkOption {
type = types.nullOr types.str;
default = name;
description = "Name of the worker";
description = lib.mdDoc "Name of the worker";
};
type = mkOption {
type = types.nullOr (types.enum [
"normal" "controller" "fuzzy" "rspamd_proxy" "lua" "proxy"
]);
description = ''
The type of this worker. The type <literal>proxy</literal> is
description = lib.mdDoc ''
The type of this worker. The type `proxy` is
deprecated and only kept for backwards compatibility and should be
replaced with <literal>rspamd_proxy</literal>.
replaced with `rspamd_proxy`.
'';
apply = let
from = "services.rspamd.workers.\"${name}\".type";
@ -77,7 +77,7 @@ let
bindSockets = mkOption {
type = types.listOf (types.either types.str (types.submodule bindSocketOpts));
default = [];
description = ''
description = lib.mdDoc ''
List of sockets to listen, in format acceptable by rspamd
'';
example = [{
@ -94,21 +94,21 @@ let
count = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
description = lib.mdDoc ''
Number of worker instances to run
'';
};
includes = mkOption {
type = types.listOf types.str;
default = [];
description = ''
description = lib.mdDoc ''
List of files to include in configuration
'';
};
extraConfig = mkOption {
type = types.lines;
default = "";
description = "Additional entries to put verbatim into worker section of rspamd config file.";
description = lib.mdDoc "Additional entries to put verbatim into worker section of rspamd config file.";
};
};
config = mkIf (name == "normal" || name == "controller" || name == "fuzzy" || name == "rspamd_proxy") {
@ -186,7 +186,7 @@ let
enable = mkOption {
type = types.bool;
default = true;
description = ''
description = lib.mdDoc ''
Whether this file ${prefix} should be generated. This
option allows specific ${prefix} files to be disabled.
'';
@ -195,12 +195,12 @@ let
text = mkOption {
default = null;
type = types.nullOr types.lines;
description = "Text of the file.";
description = lib.mdDoc "Text of the file.";
};
source = mkOption {
type = types.path;
description = "Path of the source file.";
description = lib.mdDoc "Path of the source file.";
};
};
config = {
@ -232,14 +232,14 @@ in
debug = mkOption {
type = types.bool;
default = false;
description = "Whether to run the rspamd daemon in debug mode.";
description = lib.mdDoc "Whether to run the rspamd daemon in debug mode.";
};
locals = mkOption {
type = with types; attrsOf (submodule (configFileModule "locals"));
default = {};
description = ''
Local configuration files, written into <filename>/etc/rspamd/local.d/{name}</filename>.
description = lib.mdDoc ''
Local configuration files, written into {file}`/etc/rspamd/local.d/{name}`.
'';
example = literalExpression ''
{ "redis.conf".source = "/nix/store/.../etc/dir/redis.conf";
@ -251,8 +251,8 @@ in
overrides = mkOption {
type = with types; attrsOf (submodule (configFileModule "overrides"));
default = {};
description = ''
Overridden configuration files, written into <filename>/etc/rspamd/override.d/{name}</filename>.
description = lib.mdDoc ''
Overridden configuration files, written into {file}`/etc/rspamd/override.d/{name}`.
'';
example = literalExpression ''
{ "redis.conf".source = "/nix/store/.../etc/dir/redis.conf";
@ -264,15 +264,15 @@ in
localLuaRules = mkOption {
default = null;
type = types.nullOr types.path;
description = ''
Path of file to link to <filename>/etc/rspamd/rspamd.local.lua</filename> for local
description = lib.mdDoc ''
Path of file to link to {file}`/etc/rspamd/rspamd.local.lua` for local
rules written in Lua
'';
};
workers = mkOption {
type = with types; attrsOf (submodule workerOpts);
description = ''
description = lib.mdDoc ''
Attribute set of workers to start.
'';
default = {
@ -301,7 +301,7 @@ in
extraConfig = mkOption {
type = types.lines;
default = "";
description = ''
description = lib.mdDoc ''
Extra configuration to add at the end of the rspamd configuration
file.
'';
@ -310,7 +310,7 @@ in
user = mkOption {
type = types.str;
default = "rspamd";
description = ''
description = lib.mdDoc ''
User to use when no root privileges are required.
'';
};
@ -318,7 +318,7 @@ in
group = mkOption {
type = types.str;
default = "rspamd";
description = ''
description = lib.mdDoc ''
Group to use when no root privileges are required.
'';
};
@ -327,12 +327,12 @@ in
enable = mkOption {
type = types.bool;
default = false;
description = "Add rspamd milter to postfix main.conf";
description = lib.mdDoc "Add rspamd milter to postfix main.conf";
};
config = mkOption {
type = with types; attrsOf (oneOf [ bool str (listOf str) ]);
description = ''
description = lib.mdDoc ''
Addon to postfix configuration
'';
default = {