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. --- .../services/networking/blockbook-frontend.nix | 58 +++++++++++----------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'nixos/modules/services/networking/blockbook-frontend.nix') diff --git a/nixos/modules/services/networking/blockbook-frontend.nix b/nixos/modules/services/networking/blockbook-frontend.nix index eeea521c8d5..0164883c747 100644 --- a/nixos/modules/services/networking/blockbook-frontend.nix +++ b/nixos/modules/services/networking/blockbook-frontend.nix @@ -16,28 +16,28 @@ let type = types.package; default = pkgs.blockbook; defaultText = literalExpression "pkgs.blockbook"; - description = "Which blockbook package to use."; + description = lib.mdDoc "Which blockbook package to use."; }; user = mkOption { type = types.str; default = "blockbook-frontend-${name}"; - description = "The user as which to run blockbook-frontend-${name}."; + description = lib.mdDoc "The user as which to run blockbook-frontend-${name}."; }; group = mkOption { type = types.str; default = "${config.user}"; - description = "The group as which to run blockbook-frontend-${name}."; + description = lib.mdDoc "The group as which to run blockbook-frontend-${name}."; }; certFile = mkOption { type = types.nullOr types.path; default = null; example = "/etc/secrets/blockbook-frontend-${name}/certFile"; - description = '' + description = lib.mdDoc '' To enable SSL, specify path to the name of certificate files without extension. - Expecting certFile.crt and certFile.key. + Expecting {file}`certFile.crt` and {file}`certFile.key`. ''; }; @@ -45,14 +45,14 @@ let type = with types; nullOr path; default = null; example = "${config.dataDir}/config.json"; - description = "Location of the blockbook configuration file."; + description = lib.mdDoc "Location of the blockbook configuration file."; }; coinName = mkOption { type = types.str; default = "Bitcoin"; - description = '' - See + description = lib.mdDoc '' + See for current of coins supported in master (Note: may differ from release). ''; }; @@ -62,8 +62,8 @@ let default = "${config.package}/share/css/"; defaultText = literalExpression ''"''${package}/share/css/"''; example = literalExpression ''"''${dataDir}/static/css/"''; - description = '' - Location of the dir with main.css CSS file. + description = lib.mdDoc '' + Location of the dir with {file}`main.css` CSS file. By default, the one shipped with the package is used. ''; }; @@ -71,68 +71,68 @@ let dataDir = mkOption { type = types.path; default = "/var/lib/blockbook-frontend-${name}"; - description = "Location of blockbook-frontend-${name} data directory."; + description = lib.mdDoc "Location of blockbook-frontend-${name} data directory."; }; debug = mkOption { type = types.bool; default = false; - description = "Debug mode, return more verbose errors, reload templates on each request."; + description = lib.mdDoc "Debug mode, return more verbose errors, reload templates on each request."; }; internal = mkOption { type = types.nullOr types.str; default = ":9030"; - description = "Internal http server binding [address]:port."; + description = lib.mdDoc "Internal http server binding `[address]:port`."; }; messageQueueBinding = mkOption { type = types.str; default = "tcp://127.0.0.1:38330"; - description = "Message Queue Binding address:port."; + description = lib.mdDoc "Message Queue Binding `address:port`."; }; public = mkOption { type = types.nullOr types.str; default = ":9130"; - description = "Public http server binding [address]:port."; + description = lib.mdDoc "Public http server binding `[address]:port`."; }; rpc = { url = mkOption { type = types.str; default = "http://127.0.0.1"; - description = "URL for JSON-RPC connections."; + description = lib.mdDoc "URL for JSON-RPC connections."; }; port = mkOption { type = types.port; default = 8030; - description = "Port for JSON-RPC connections."; + description = lib.mdDoc "Port for JSON-RPC connections."; }; user = mkOption { type = types.str; default = "rpc"; - description = "Username for JSON-RPC connections."; + description = lib.mdDoc "Username for JSON-RPC connections."; }; password = mkOption { type = types.str; default = "rpc"; - description = '' + description = lib.mdDoc '' RPC password for JSON-RPC connections. Warning: this is stored in cleartext in the Nix store!!! - Use configFile or passwordFile if needed. + Use `configFile` or `passwordFile` if needed. ''; }; passwordFile = mkOption { type = types.nullOr types.path; default = null; - description = '' + description = lib.mdDoc '' File containing password of the RPC user. - Note: This options is ignored when configFile is used. + Note: This options is ignored when `configFile` is used. ''; }; }; @@ -140,7 +140,7 @@ let sync = mkOption { type = types.bool; default = true; - description = "Synchronizes until tip, if together with zeromq, keeps index synchronized."; + description = lib.mdDoc "Synchronizes until tip, if together with zeromq, keeps index synchronized."; }; templateDir = mkOption { @@ -148,7 +148,7 @@ let default = "${config.package}/share/templates/"; defaultText = literalExpression ''"''${package}/share/templates/"''; example = literalExpression ''"''${dataDir}/templates/static/"''; - description = "Location of the HTML templates. By default, ones shipped with the package are used."; + description = lib.mdDoc "Location of the HTML templates. By default, ones shipped with the package are used."; }; extraConfig = mkOption { @@ -171,10 +171,10 @@ let "mempool_sub_workers" = 2; "block_addresses_to_keep" = 300; }''; - description = '' - Additional configurations to be appended to coin.conf. + description = lib.mdDoc '' + Additional configurations to be appended to {file}`coin.conf`. Overrides any already defined configuration options. - See + See for current configuration options supported in master (Note: may differ from release). ''; }; @@ -183,7 +183,7 @@ let type = types.listOf types.str; default = []; example = [ "-workers=1" "-dbcache=0" "-logtosderr" ]; - description = '' + description = lib.mdDoc '' Extra command line options to pass to Blockbook. Run blockbook --help to list all available options. ''; @@ -198,7 +198,7 @@ in services.blockbook-frontend = mkOption { type = types.attrsOf (types.submodule blockbookOpts); default = {}; - description = "Specification of one or more blockbook-frontend instances."; + description = lib.mdDoc "Specification of one or more blockbook-frontend instances."; }; }; -- cgit 1.4.1