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
3 changed files with 8 additions and 0 deletions

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)";
};
};
};