summary refs log tree commit diff
path: root/lib/options.nix
diff options
context:
space:
mode:
authorpennae <github@quasiparticle.net>2023-03-04 22:52:02 +0100
committerpennae <82953136+pennae@users.noreply.github.com>2023-03-05 01:21:46 +0100
commitf0e8db002b17d33dbe993183a827a4eb54206367 (patch)
tree472700d8eff15a93008696d950a6b894bd964503 /lib/options.nix
parenta6c145df9e5da19ec59b69fae40a4fbdf905fc5f (diff)
lib/options: fix mkPackageOption docs
nixdoc takes everything from Type: to Example: as the type, which
misrendered a large part of the docs. it also drops sorely needed spaces
where the type had line breaks, so all has to be on one line (or use
non-standard literal spaces, which is probably worse).

also clarify what the `?` for arguments mean while we're here.
Diffstat (limited to 'lib/options.nix')
-rw-r--r--lib/options.nix12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/options.nix b/lib/options.nix
index 20e8fb8d5ed31..4780a56fc1c37 100644
--- a/lib/options.nix
+++ b/lib/options.nix
@@ -110,10 +110,6 @@ rec {
   /* Creates an Option attribute set for an option that specifies the
      package a module should use for some purpose.
 
-     Type: mkPackageOption :: pkgs -> (string|[string]) ->
-      { default? :: [string], example? :: null|string|[string], extraDescription? :: string } ->
-      option
-
      The package is specified in the third argument under `default` as a list of strings
      representing its attribute path in nixpkgs (or another package set).
      Because of this, you need to pass nixpkgs itself (or a subset) as the first argument.
@@ -133,6 +129,8 @@ rec {
 
      If you wish to explicitly provide no default, pass `null` as `default`.
 
+     Type: mkPackageOption :: pkgs -> (string|[string]) -> { default? :: [string], example? :: null|string|[string], extraDescription? :: string } -> option
+
      Example:
        mkPackageOption pkgs "hello" { }
        => { _type = "option"; default = «derivation /nix/store/3r2vg51hlxj3cx5vscp0vkv60bqxkaq0-hello-2.10.drv»; defaultText = { ... }; description = "The hello package to use."; type = { ... }; }
@@ -157,11 +155,11 @@ rec {
       # Name for the package, shown in option description
       name:
       {
-        # The attribute path where the default package is located
+        # The attribute path where the default package is located (may be omitted)
         default ? name,
-        # A string or an attribute path to use as an example
+        # A string or an attribute path to use as an example (may be omitted)
         example ? null,
-        # Additional text to include in the option description
+        # Additional text to include in the option description (may be omitted)
         extraDescription ? "",
       }:
       let