treewide: add `defaultText` (manual)

This enables generating module option documentation.

Add `defaultText` to options where the default value can't be
evaluated during metadata generation.
This commit is contained in:
Erik Arvstedt 2021-12-08 04:07:27 +01:00
parent f0096371bf
commit d24c029435
No known key found for this signature in database
GPG Key ID: 33312B944DD97846
3 changed files with 8 additions and 0 deletions

View File

@ -44,11 +44,13 @@ let
}; };
cli = mkOption { cli = mkOption {
default = cli; default = cli;
defaultText = "(See source)";
}; };
# Used by ./joinmarket-ob-watcher.nix # Used by ./joinmarket-ob-watcher.nix
ircServers = mkOption { ircServers = mkOption {
readOnly = true; readOnly = true;
default = ircServers; default = ircServers;
defaultText = "(See source)";
}; };
# This option is only used by netns-isolation. # This option is only used by netns-isolation.
# Tor is always enabled. # Tor is always enabled.

View File

@ -7,17 +7,20 @@ with lib;
pkgs = mkOption { pkgs = mkOption {
type = types.attrs; type = types.attrs;
default = (import ../pkgs { inherit pkgs; }).modulesPkgs; default = (import ../pkgs { inherit pkgs; }).modulesPkgs;
defaultText = "nix-bitcoin/pkgs.modulesPkgs";
}; };
lib = mkOption { lib = mkOption {
readOnly = true; readOnly = true;
default = import ../pkgs/lib.nix lib pkgs; default = import ../pkgs/lib.nix lib pkgs;
defaultText = "nix-bitcoin/pkgs/lib.nix";
}; };
torClientAddressWithPort = mkOption { torClientAddressWithPort = mkOption {
readOnly = true; readOnly = true;
default = with config.services.tor.client.socksListenAddress; default = with config.services.tor.client.socksListenAddress;
"${addr}:${toString port}"; "${addr}:${toString port}";
defaultText = "(See source)";
}; };
# Torify binary that works with custom Tor SOCKS addresses # Torify binary that works with custom Tor SOCKS addresses
@ -29,6 +32,7 @@ with lib;
--address ${config.services.tor.client.socksListenAddress.addr} \ --address ${config.services.tor.client.socksListenAddress.addr} \
"$@" "$@"
''; '';
defaultText = "(See source)";
}; };
# A helper for using doas instead of sudo when doas is enabled # A helper for using doas instead of sudo when doas is enabled
@ -38,6 +42,7 @@ with lib;
# TODO-EXTERNAL: Use absolute path until https://github.com/NixOS/nixpkgs/pull/133622 is available. # TODO-EXTERNAL: Use absolute path until https://github.com/NixOS/nixpkgs/pull/133622 is available.
then "/run/wrappers/bin/doas -u" then "/run/wrappers/bin/doas -u"
else "sudo -u"; else "sudo -u";
defaultText = "(See source)";
}; };
}; };
}; };

View File

@ -8,6 +8,7 @@ let
program = mkOption { program = mkOption {
readOnly = true; readOnly = true;
default = script; default = script;
defaultText = "(See source)";
}; };
}; };
}; };