treewide: add literalDocBook text to options with complex defaults

some options have default that are best described in prose, such as
defaults that depend on the system stateVersion, defaults that are
derivations specific to the surrounding context, or those where the
expression is much longer and harder to understand than a simple text
snippet.
main
pennae 3 years ago
parent 6eaf4f90c2
commit 2d564521c0
  1. 1
      nixos/modules/programs/gnupg.nix
  2. 4
      nixos/modules/services/audio/mpdscribble.nix
  3. 6
      nixos/modules/services/cluster/kubernetes/addons/dns.nix
  4. 1
      nixos/modules/services/cluster/kubernetes/kubelet.nix
  5. 4
      nixos/modules/services/computing/slurm/slurm.nix
  6. 1
      nixos/modules/services/games/quake3-server.nix
  7. 1
      nixos/modules/services/misc/gitweb.nix
  8. 23
      nixos/modules/services/misc/matrix-synapse.nix
  9. 1
      nixos/modules/services/misc/rippled.nix
  10. 3
      nixos/modules/services/monitoring/thanos.nix
  11. 1
      nixos/modules/services/networking/firewall.nix
  12. 24
      nixos/modules/services/networking/syncthing.nix
  13. 1
      nixos/modules/services/web-apps/keycloak.nix
  14. 1
      nixos/modules/services/web-apps/nextcloud.nix
  15. 6
      nixos/modules/services/web-servers/lighttpd/collectd.nix
  16. 3
      nixos/modules/services/x11/display-managers/default.nix
  17. 1
      nixos/modules/system/activation/activation-script.nix
  18. 8
      nixos/modules/system/boot/plymouth.nix
  19. 1
      nixos/modules/tasks/filesystems/zfs.nix
  20. 4
      nixos/modules/virtualisation/cri-o.nix

@ -71,6 +71,7 @@ in
type = types.nullOr (types.enum pkgs.pinentry.flavors);
example = "gnome3";
default = defaultPinentryFlavor;
defaultText = literalDocBook ''matching the configured desktop environment'';
description = ''
Which pinentry interface to use. If not null, the path to the
pinentry binary will be passed to gpg-agent via commandline and

@ -128,6 +128,10 @@ in {
mpdCfg.credentials).passwordFile
else
null;
defaultText = literalDocBook ''
The first password file with read access configured for MPD when using a local instance,
otherwise <literal>null</literal>.
'';
type = types.nullOr types.str;
description = ''
File containing the password for the mpd daemon.

@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }:
{ config, options, pkgs, lib, ... }:
with lib;
@ -23,6 +23,10 @@ in {
take 3 (splitString "." config.services.kubernetes.apiserver.serviceClusterIpRange
))
) + ".254";
defaultText = literalDocBook ''
The <literal>x.y.z.254</literal> IP of
<literal>config.${options.services.kubernetes.apiserver.serviceClusterIpRange}</literal>.
'';
type = types.str;
};

@ -36,6 +36,7 @@ let
key = mkOption {
description = "Key of taint.";
default = name;
defaultText = literalDocBook "Name of this submodule.";
type = str;
};
value = mkOption {

@ -281,6 +281,10 @@ in
type = types.path;
internal = true;
default = etcSlurm;
defaultText = literalDocBook ''
Directory created from generated config files and
<literal>config.${opt.extraConfigPaths}</literal>.
'';
description = ''
Path to directory with slurm config files. This option is set by default from the
Slurm module and is meant to make the Slurm config file available to other modules.

@ -71,6 +71,7 @@ in {
baseq3 = mkOption {
type = types.either types.package types.path;
default = defaultBaseq3;
defaultText = literalDocBook "Manually downloaded Quake 3 installation directory.";
example = "/var/lib/q3ds";
description = ''
Path to the baseq3 files (pak*.pk3). If this is on the nix store (type = package) all .pk3 files should be saved

@ -47,6 +47,7 @@ in
$highlight_bin = "${pkgs.highlight}/bin/highlight";
${cfg.extraConfig}
'';
defaultText = literalDocBook "generated config file";
type = types.path;
readOnly = true;
internal = true;

@ -403,6 +403,29 @@ in {
database = cfg.database_name;
};
}.${cfg.database_type};
defaultText = literalDocBook ''
<variablelist>
<varlistentry>
<term>using sqlite3</term>
<listitem>
<programlisting>
{ database = "''${config.${opt.dataDir}}/homeserver.db"; }
</programlisting>
</listitem>
</varlistentry>
<varlistentry>
<term>using psycopg2</term>
<listitem>
<programlisting>
psycopg2 = {
user = config.${opt.database_user};
database = config.${opt.database_name};
}
</programlisting>
</listitem>
</varlistentry>
</variablelist>
'';
description = ''
Arguments to pass to the engine.
'';

@ -401,6 +401,7 @@ in
config = mkOption {
internal = true;
default = pkgs.writeText "rippled.conf" rippledCfg;
defaultText = literalDocBook "generated config file";
};
};
};

@ -83,6 +83,9 @@ let
mkArgumentsOption = cmd: mkOption {
type = types.listOf types.str;
default = argumentsOf cmd;
defaultText = literalDocBook ''
calculated from <literal>config.services.thanos.${cmd}</literal>
'';
description = ''
Arguments to the <literal>thanos ${cmd}</literal> command.

@ -421,6 +421,7 @@ in
checkReversePath = mkOption {
type = types.either types.bool (types.enum ["strict" "loose"]);
default = kernelHasRPFilter;
defaultText = literalDocBook "<literal>true</literal> if supported by the chosen kernel";
example = "loose";
description =
''

@ -1,9 +1,10 @@
{ config, lib, pkgs, ... }:
{ config, lib, options, pkgs, ... }:
with lib;
let
cfg = config.services.syncthing;
opt = options.services.syncthing;
defaultUser = "syncthing";
defaultGroup = defaultUser;
@ -431,7 +432,26 @@ in {
The path where the settings and keys will exist.
'';
default = cfg.dataDir + optionalString cond "/.config/syncthing";
defaultText = literalExpression "dataDir${optionalString cond " + \"/.config/syncthing\""}";
defaultText = literalDocBook ''
<variablelist>
<varlistentry>
<term><literal>stateVersion >= 19.03</literal></term>
<listitem>
<programlisting>
config.${opt.dataDir} + "/.config/syncthing"
</programlisting>
</listitem>
</varlistentry>
<varlistentry>
<term>otherwise</term>
<listitem>
<programlisting>
config.${opt.dataDir}
</programlisting>
</listitem>
</varlistentry>
</variablelist>
'';
};
extraFlags = mkOption {

@ -140,6 +140,7 @@ in
lib.mkOption {
type = lib.types.port;
default = dbPorts.${cfg.database.type};
defaultText = lib.literalDocBook "default port of selected database";
description = ''
Port of the database to connect to.
'';

@ -499,6 +499,7 @@ in {
occ = mkOption {
type = types.package;
default = occ;
defaultText = literalDocBook "generated script";
internal = true;
description = ''
The nextcloud-occ program preconfigured to target this Nextcloud instance.

@ -1,9 +1,10 @@
{ config, lib, pkgs, ... }:
{ config, lib, options, pkgs, ... }:
with lib;
let
cfg = config.services.lighttpd.collectd;
opt = options.services.lighttpd.collectd;
collectionConf = pkgs.writeText "collection.conf" ''
datadir: "${config.services.collectd.dataDir}"
@ -29,6 +30,9 @@ in
collectionCgi = mkOption {
type = types.path;
default = defaultCollectionCgi;
defaultText = literalDocBook ''
<literal>config.${options.services.collectd.package}</literal> configured for lighttpd
'';
description = ''
Path to collection.cgi script from (collectd sources)/contrib/collection.cgi
This option allows to use a customized version

@ -279,6 +279,9 @@ in
defaultSessionFromLegacyOptions
else
null;
defaultText = literalDocBook ''
Taken from display manager settings or window manager settings, if either is set.
'';
example = "gnome";
description = ''
Graphical session to pre-select in the session chooser (only effective for GDM, LightDM and SDDM).

@ -142,6 +142,7 @@ in
readOnly = true;
internal = true;
default = systemActivationScript (removeAttrs config.system.activationScripts [ "script" ]) true;
defaultText = literalDocBook "generated activation script";
};
system.userActivationScripts = mkOption {

@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }:
{ config, lib, options, pkgs, ... }:
with lib;
@ -7,6 +7,7 @@ let
inherit (pkgs) plymouth nixos-icons;
cfg = config.boot.plymouth;
opt = options.boot.plymouth;
nixosBreezePlymouth = pkgs.plasma5Packages.breeze-plymouth.override {
logoFile = cfg.logo;
@ -71,6 +72,11 @@ in
themePackages = mkOption {
default = lib.optional (cfg.theme == "breeze") nixosBreezePlymouth;
defaultText = literalDocBook ''
A NixOS branded variant of the breeze theme when
<literal>config.${opt.theme} == "breeze"</literal>, otherwise
<literal>[ ]</literal>.
'';
type = types.listOf types.package;
description = ''
Extra theme packages for plymouth.

@ -112,6 +112,7 @@ in
readOnly = true;
type = types.bool;
default = inInitrd || inSystem;
defaultText = literalDocBook "<literal>true</literal> if ZFS filesystem support is enabled";
description = "True if ZFS filesystem support is enabled";
};

@ -71,6 +71,10 @@ in
package = mkOption {
type = types.package;
default = crioPackage;
defaultText = literalDocBook ''
<literal>pkgs.cri-o</literal> built with
<literal>config.${opt.extraPackages}</literal>.
'';
internal = true;
description = ''
The final CRI-O package (including extra packages).

Loading…
Cancel
Save