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 {
default = cli;
defaultText = "(See source)";
};
# Used by ./joinmarket-ob-watcher.nix
ircServers = mkOption {
readOnly = true;
default = ircServers;
defaultText = "(See source)";
};
# This option is only used by netns-isolation.
# Tor is always enabled.

View File

@ -7,17 +7,20 @@ with lib;
pkgs = mkOption {
type = types.attrs;
default = (import ../pkgs { inherit pkgs; }).modulesPkgs;
defaultText = "nix-bitcoin/pkgs.modulesPkgs";
};
lib = mkOption {
readOnly = true;
default = import ../pkgs/lib.nix lib pkgs;
defaultText = "nix-bitcoin/pkgs/lib.nix";
};
torClientAddressWithPort = mkOption {
readOnly = true;
default = with config.services.tor.client.socksListenAddress;
"${addr}:${toString port}";
defaultText = "(See source)";
};
# Torify binary that works with custom Tor SOCKS addresses
@ -29,6 +32,7 @@ with lib;
--address ${config.services.tor.client.socksListenAddress.addr} \
"$@"
'';
defaultText = "(See source)";
};
# 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.
then "/run/wrappers/bin/doas -u"
else "sudo -u";
defaultText = "(See source)";
};
};
};

View File

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