0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-14 06:00:33 +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

@ -30,13 +30,13 @@ in {
enable = mkOption {
default = false;
type = types.bool;
description = "Whether to enable the sshguard service.";
description = lib.mdDoc "Whether to enable the sshguard service.";
};
attack_threshold = mkOption {
default = 30;
type = types.int;
description = ''
description = lib.mdDoc ''
Block attackers when their cumulative attack score exceeds threshold. Most attacks have a score of 10.
'';
};
@ -45,7 +45,7 @@ in {
default = null;
example = 120;
type = types.nullOr types.int;
description = ''
description = lib.mdDoc ''
Blacklist an attacker when its score exceeds threshold. Blacklisted addresses are loaded from and added to blacklist-file.
'';
};
@ -53,7 +53,7 @@ in {
blacklist_file = mkOption {
default = "/var/lib/sshguard/blacklist.db";
type = types.path;
description = ''
description = lib.mdDoc ''
Blacklist an attacker when its score exceeds threshold. Blacklisted addresses are loaded from and added to blacklist-file.
'';
};
@ -61,7 +61,7 @@ in {
blocktime = mkOption {
default = 120;
type = types.int;
description = ''
description = lib.mdDoc ''
Block attackers for initially blocktime seconds after exceeding threshold. Subsequent blocks increase by a factor of 1.5.
sshguard unblocks attacks at random intervals, so actual block times will be longer.
@ -71,7 +71,7 @@ in {
detection_time = mkOption {
default = 1800;
type = types.int;
description = ''
description = lib.mdDoc ''
Remember potential attackers for up to detection_time seconds before resetting their score.
'';
};
@ -80,7 +80,7 @@ in {
default = [ ];
example = [ "198.51.100.56" "198.51.100.2" ];
type = types.listOf types.str;
description = ''
description = lib.mdDoc ''
Whitelist a list of addresses, hostnames, or address blocks.
'';
};
@ -89,7 +89,7 @@ in {
default = [ "sshd" ];
example = [ "sshd" "exim" ];
type = types.listOf types.str;
description = ''
description = lib.mdDoc ''
Systemd services sshguard should receive logs of.
'';
};