treewide: improve option descriptions

This commit is contained in:
Tobias Happ 2022-10-26 12:05:14 +02:00
parent 7b039faa83
commit b76fb0954e
10 changed files with 50 additions and 48 deletions

View file

@ -28,8 +28,8 @@ let
type = types.bool; type = types.bool;
default = true; default = true;
description = '' description = ''
Whether this /etc file should be generated. This Whether this <filename>/etc</filename> file should be generated. This
option allows specific /etc files to be disabled. option allows specific <filename>/etc</filename> files to be disabled.
''; '';
}; };

View file

@ -1,4 +1,4 @@
# Copyright (c) 2019-2020, see AUTHORS. Licensed under MIT License, see LICENSE. # Copyright (c) 2019-2022, see AUTHORS. Licensed under MIT License, see LICENSE.
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
@ -18,13 +18,13 @@ in
binSh = mkOption { binSh = mkOption {
type = types.str; type = types.str;
readOnly = true; readOnly = true;
description = "Path to /bin/sh executable."; description = "Path to <filename>/bin/sh</filename> executable.";
}; };
usrBinEnv = mkOption { usrBinEnv = mkOption {
type = types.str; type = types.str;
readOnly = true; readOnly = true;
description = "Path to /usr/bin/env executable."; description = "Path to <filename>/usr/bin/env</filename> executable.";
}; };
}; };

View file

@ -37,7 +37,7 @@ in
type = types.package; type = types.package;
readOnly = true; readOnly = true;
internal = true; internal = true;
description = "proot-static package."; description = "<literal>proot-static</literal> package.";
}; };
}; };

View file

@ -31,7 +31,7 @@ in
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.nix; default = pkgs.nix;
defaultText = "pkgs.nix"; defaultText = literalExpression "pkgs.nix";
description = '' description = ''
This option specifies the Nix package instance to use throughout the system. This option specifies the Nix package instance to use throughout the system.
''; '';
@ -101,9 +101,7 @@ in
} }
)); ));
default = { }; default = { };
description = '' description = "A system-wide flake registry.";
A system-wide flake registry.
'';
}; };
substituters = mkOption { substituters = mkOption {
@ -128,7 +126,7 @@ in
extraOptions = mkOption { extraOptions = mkOption {
type = types.lines; type = types.lines;
default = ""; default = "";
description = "Extra config to be appended to /etc/nix/nix.conf."; description = "Extra config to be appended to <filename>/etc/nix/nix.conf</filename>.";
}; };
}; };

View file

@ -67,7 +67,9 @@ in
example = { EDITOR = "emacs"; GS_OPTIONS = "-sPAPERSIZE=a4"; }; example = { EDITOR = "emacs"; GS_OPTIONS = "-sPAPERSIZE=a4"; };
description = '' description = ''
Environment variables to always set at login. Environment variables to always set at login.
</para><para> </para><para>
The values may refer to other environment variables using The values may refer to other environment variables using
POSIX.2 style variable references. For example, a variable POSIX.2 style variable references. For example, a variable
<varname>parameter</varname> may be referenced as <varname>parameter</varname> may be referenced as
@ -76,19 +78,24 @@ in
<code>''${parameter:-foo}</code> and, similarly, an alternate <code>''${parameter:-foo}</code> and, similarly, an alternate
value <literal>bar</literal> can be given as per value <literal>bar</literal> can be given as per
<code>''${parameter:+bar}</code>. <code>''${parameter:+bar}</code>.
</para><para> </para><para>
Note, these variables may be set in any order so no session Note, these variables may be set in any order so no session
variable may have a runtime dependency on another session variable may have a runtime dependency on another session
variable. In particular code like variable. In particular code like
<programlisting language="nix"> <programlisting language="nix">
environment.sessionVariables = { environment.sessionVariables = {
FOO = "Hello"; FOO = "Hello";
BAR = "$FOO World!"; BAR = "$FOO World!";
}; };
</programlisting> </programlisting>
may not work as expected. If you need to reference another may not work as expected. If you need to reference another
session variable, then do so inside Nix instead. The above session variable, then do so inside Nix instead. The above
example then becomes example then becomes
<programlisting language="nix"> <programlisting language="nix">
environment.sessionVariables = { environment.sessionVariables = {
FOO = "Hello"; FOO = "Hello";

View file

@ -53,7 +53,10 @@ in
default = null; default = null;
# Prevent the entire submodule being included in the documentation. # Prevent the entire submodule being included in the documentation.
visible = "shallow"; visible = "shallow";
description = "Home Manager configuration."; description = ''
Home Manager configuration, see
<link xlink:href="https://nix-community.github.io/home-manager/options.html" />.
'';
}; };
extraSpecialArgs = mkOption { extraSpecialArgs = mkOption {
@ -67,14 +70,7 @@ in
}; };
sharedModules = mkOption { sharedModules = mkOption {
type = with types; type = with types; listOf raw;
# TODO: use types.raw once this PR is merged: https://github.com/NixOS/nixpkgs/pull/132448
listOf (mkOptionType {
name = "submodule";
inherit (submodule { }) check;
merge = lib.options.mergeOneOption;
description = "Home Manager modules";
});
default = [ ]; default = [ ];
example = literalExpression "[ { home.packages = [ nixpkgs-fmt ]; } ]"; example = literalExpression "[ { home.packages = [ nixpkgs-fmt ]; } ]";
description = '' description = ''

View file

@ -117,8 +117,7 @@ in
overlays = mkOption { overlays = mkOption {
default = null; default = null;
example = literalExpression example = literalExpression ''
''
[ (self: super: { [ (self: super: {
openssh = super.openssh.override { openssh = super.openssh.override {
hpnSupport = true; hpnSupport = true;

View file

@ -20,8 +20,7 @@ in
example = lib.literalExpression example = lib.literalExpression
''"''${pkgs.terminus_font_ttf}/share/fonts/truetype/TerminusTTF.ttf"''; ''"''${pkgs.terminus_font_ttf}/share/fonts/truetype/TerminusTTF.ttf"'';
description = '' description = ''
Font used for the terminal. Font used for the terminal. Must be a path to a TTF font.
Must be a path to a TTF font.
''; '';
}; };

View file

@ -50,6 +50,7 @@ in
shell = mkOption { shell = mkOption {
type = types.path; type = types.path;
default = "${pkgs.bashInteractive}/bin/bash"; default = "${pkgs.bashInteractive}/bin/bash";
defaultText = literalExpression "${pkgs.bashInteractive}/bin/bash";
description = "Path to login shell."; description = "Path to login shell.";
}; };

View file

@ -18,7 +18,9 @@ with lib;
configuration defaults in a way that is incompatible with configuration defaults in a way that is incompatible with
stateful data. This could, for example, include switching the stateful data. This could, for example, include switching the
default data format or location of a file. default data format or location of a file.
</para><para> </para><para>
The <emphasis>state version</emphasis> indicates which default The <emphasis>state version</emphasis> indicates which default
settings are in effect and will therefore help avoid breaking settings are in effect and will therefore help avoid breaking
program configurations. Switching to a higher state version program configurations. Switching to a higher state version