From 2e751c0772b9d48ff6923569adfa661b030ab6a2 Mon Sep 17 00:00:00 2001 From: pennae Date: Thu, 28 Jul 2022 23:19:15 +0200 Subject: 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 and , so any option using such tags will not be converted at all. --- nixos/modules/services/monitoring/zabbix-proxy.nix | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'nixos/modules/services/monitoring/zabbix-proxy.nix') diff --git a/nixos/modules/services/monitoring/zabbix-proxy.nix b/nixos/modules/services/monitoring/zabbix-proxy.nix index 0ebd7bcff834..9cfe1bdaa205 100644 --- a/nixos/modules/services/monitoring/zabbix-proxy.nix +++ b/nixos/modules/services/monitoring/zabbix-proxy.nix @@ -42,7 +42,7 @@ in server = mkOption { type = types.str; - description = '' + description = lib.mdDoc '' The IP address or hostname of the Zabbix server to connect to. ''; }; @@ -54,7 +54,7 @@ in else if cfg.database.type == "pgsql" then pkgs.zabbix.proxy-pgsql else pkgs.zabbix.proxy-sqlite; defaultText = literalExpression "pkgs.zabbix.proxy-pgsql"; - description = "The Zabbix package to use."; + description = lib.mdDoc "The Zabbix package to use."; }; extraPackages = mkOption { @@ -69,7 +69,7 @@ in modules = mkOption { type = types.attrsOf types.package; - description = "A set of modules to load."; + description = lib.mdDoc "A set of modules to load."; default = {}; example = literalExpression '' { @@ -92,13 +92,13 @@ in type = types.enum [ "mysql" "pgsql" "sqlite" ]; example = "mysql"; default = "pgsql"; - description = "Database engine to use."; + description = lib.mdDoc "Database engine to use."; }; host = mkOption { type = types.str; default = "localhost"; - description = "Database host address."; + description = lib.mdDoc "Database host address."; }; port = mkOption { @@ -109,29 +109,29 @@ in then config.${options.services.mysql.port} else config.${options.services.postgresql.port} ''; - description = "Database host port."; + description = lib.mdDoc "Database host port."; }; name = mkOption { type = types.str; default = if cfg.database.type == "sqlite" then "${stateDir}/zabbix.db" else "zabbix"; defaultText = literalExpression "zabbix"; - description = "Database name."; + description = lib.mdDoc "Database name."; }; user = mkOption { type = types.str; default = "zabbix"; - description = "Database user."; + description = lib.mdDoc "Database user."; }; passwordFile = mkOption { type = types.nullOr types.path; default = null; example = "/run/keys/zabbix-dbpassword"; - description = '' + description = lib.mdDoc '' A file containing the password corresponding to - . + {option}`database.user`. ''; }; @@ -139,13 +139,13 @@ in type = types.nullOr types.path; default = null; example = "/run/postgresql"; - description = "Path to the unix socket file to use for authentication."; + description = lib.mdDoc "Path to the unix socket file to use for authentication."; }; createLocally = mkOption { type = types.bool; default = true; - description = "Whether to create a local database automatically."; + description = lib.mdDoc "Whether to create a local database automatically."; }; }; @@ -153,7 +153,7 @@ in ip = mkOption { type = types.str; default = "0.0.0.0"; - description = '' + description = lib.mdDoc '' List of comma delimited IP addresses that the trapper should listen on. Trapper will listen on all network interfaces if this parameter is missing. ''; @@ -162,7 +162,7 @@ in port = mkOption { type = types.port; default = 10051; - description = '' + description = lib.mdDoc '' Listen port for trapper. ''; }; @@ -171,7 +171,7 @@ in openFirewall = mkOption { type = types.bool; default = false; - description = '' + description = lib.mdDoc '' Open ports in the firewall for the Zabbix Proxy. ''; }; @@ -179,9 +179,9 @@ in settings = mkOption { type = with types; attrsOf (oneOf [ int str (listOf str) ]); default = {}; - description = '' + description = lib.mdDoc '' Zabbix Proxy configuration. Refer to - + for details on supported values. ''; example = { -- cgit 1.4.1