diff options
-rw-r--r-- | lib/options.nix | 1 | ||||
-rw-r--r-- | nixos/doc/manual/default.nix | 3 | ||||
-rw-r--r-- | nixos/doc/manual/options-to-docbook.xsl | 8 |
3 files changed, 11 insertions, 1 deletions
diff --git a/lib/options.nix b/lib/options.nix index 939f9948cee..eed43daaecc 100644 --- a/lib/options.nix +++ b/lib/options.nix @@ -96,6 +96,7 @@ rec { declarations = filter (x: x != unknownModule) opt.declarations; internal = opt.internal or false; visible = opt.visible or true; + type = opt.type.name or null; } // (if opt ? example then { example = scrubOptionValue opt.example; } else {}) // (if opt ? default then { default = scrubOptionValue opt.default; } else {}) diff --git a/nixos/doc/manual/default.nix b/nixos/doc/manual/default.nix index b0a755c6a6f..fdfeb5ca07c 100644 --- a/nixos/doc/manual/default.nix +++ b/nixos/doc/manual/default.nix @@ -20,7 +20,8 @@ let declarations = map (fn: stripPrefix fn) opt.declarations; } // optionalAttrs (opt ? example) { example = substFunction opt.example; } - // optionalAttrs (opt ? default) { default = substFunction opt.default; }); + // optionalAttrs (opt ? default) { default = substFunction opt.default; } + // optionalAttrs (opt ? type) { type = substFunction opt.type; }); prefix = toString ../../..; diff --git a/nixos/doc/manual/options-to-docbook.xsl b/nixos/doc/manual/options-to-docbook.xsl index e81a1dc356e..af9eb0e48fb 100644 --- a/nixos/doc/manual/options-to-docbook.xsl +++ b/nixos/doc/manual/options-to-docbook.xsl @@ -34,6 +34,14 @@ select="attr[@name = 'description']/string/@value" /> </para> + <xsl:if test="attr[@name = 'type']"> + <para> + <emphasis>Type:</emphasis> + <xsl:text> </xsl:text> + <xsl:apply-templates select="attr[@name = 'type']" mode="top" /> + </para> + </xsl:if> + <xsl:if test="attr[@name = 'default']"> <para> <emphasis>Default:</emphasis> |