summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorSilvan Mosberger <contact@infinisil.com>2020-03-20 00:30:59 +0100
committerSilvan Mosberger <contact@infinisil.com>2020-08-03 22:37:01 +0200
commit2d45a62899d47c109a0b8ce4ca9d33265b8a1a37 (patch)
tree83b485697066b0735f806d5ad8ff39855f075f5e /lib
parent65e25deb06cef43d4868785a4b6a4a49dbb6cfe2 (diff)
downloadnixpkgs-2d45a62899d47c109a0b8ce4ca9d33265b8a1a37.tar
nixpkgs-2d45a62899d47c109a0b8ce4ca9d33265b8a1a37.tar.gz
nixpkgs-2d45a62899d47c109a0b8ce4ca9d33265b8a1a37.tar.bz2
nixpkgs-2d45a62899d47c109a0b8ce4ca9d33265b8a1a37.tar.lz
nixpkgs-2d45a62899d47c109a0b8ce4ca9d33265b8a1a37.tar.xz
nixpkgs-2d45a62899d47c109a0b8ce4ca9d33265b8a1a37.tar.zst
nixpkgs-2d45a62899d47c109a0b8ce4ca9d33265b8a1a37.zip
lib/types: Make submodules use the freeform type description
Submodules that have a freeform type set behave as if that was the type
of the option itself (for values that don't have an option). Since the
submodules options are shown as separate entries in the manual, it makes
sense to show the freeform type as the submodule type.
Diffstat (limited to 'lib')
-rw-r--r--lib/types.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/types.nix b/lib/types.nix
index 6fd6de7e1fd..1845b6ae339 100644
--- a/lib/types.nix
+++ b/lib/types.nix
@@ -486,9 +486,15 @@ rec {
           else value
         ) defs;
 
+        freeformType = (evalModules {
+          inherit modules specialArgs;
+          args.name = "‹name›";
+        })._module.freeformType;
+
       in
       mkOptionType rec {
         name = "submodule";
+        description = freeformType.description or name;
         check = x: isAttrs x || isFunction x || path.check x;
         merge = loc: defs:
           (evalModules {