diff --git a/doc/doc-support/default.nix b/doc/doc-support/default.nix index 53990b67719..7c00195ab39 100644 --- a/doc/doc-support/default.nix +++ b/doc/doc-support/default.nix @@ -23,6 +23,14 @@ let ''; + + # NB: This file describes the Nixpkgs manual, which happens to use module + # docs infra originally developed for NixOS. + optionsDoc = pkgs.nixosOptionsDoc { + inherit (pkgs.lib.evalModules { modules = [ ../../pkgs/top-level/config.nix ]; }) options; + documentType = "none"; + }; + in pkgs.runCommand "doc-support" {} '' mkdir result @@ -30,6 +38,7 @@ in pkgs.runCommand "doc-support" {} cd result ln -s ${locationsXml} ./function-locations.xml ln -s ${functionDocs} ./function-docs + ln -s ${optionsDoc.optionsDocBook} ./config-options.docbook.xml ln -s ${pkgs.docbook5}/xml/rng/docbook/docbook.rng ./docbook.rng ln -s ${pkgs.docbook_xsl_ns}/xml/xsl ./xsl diff --git a/doc/using/configuration.chapter.md b/doc/using/configuration.chapter.md index 932b24237c0..842450ebf47 100644 --- a/doc/using/configuration.chapter.md +++ b/doc/using/configuration.chapter.md @@ -164,6 +164,14 @@ There are several ways to tweak how Nix handles a package which has been marked Note that `permittedInsecurePackages` is only checked if `allowInsecurePredicate` is not specified. +### `config` Options Reference + +The following attributes can be passed in [`config`](#chap-packageconfig). + +```{=docbook} + +``` + ## Modify packages via `packageOverrides` {#sec-modify-via-packageOverrides} You can define a function called `packageOverrides` in your local `~/.config/nixpkgs/config.nix` to override Nix packages. It must be a function that takes pkgs as an argument and returns a modified set of packages. diff --git a/nixos/lib/make-options-doc/default.nix b/nixos/lib/make-options-doc/default.nix index 57652dd5db1..353fdb87a9f 100644 --- a/nixos/lib/make-options-doc/default.nix +++ b/nixos/lib/make-options-doc/default.nix @@ -20,6 +20,8 @@ , lib , options , transformOptions ? lib.id # function for additional tranformations of the options +, documentType ? "appendix" # TODO deprecate "appendix" in favor of "none" + # and/or rename function to moduleOptionDoc for clean slate , revision ? "" # Specify revision for the options # a set of options the docs we are generating will be merged into, as if by recursiveUpdate. # used to split the options doc build into a static part (nixos/modules) and a dynamic part @@ -161,6 +163,7 @@ in rec { ${pkgs.python3Minimal}/bin/python ${./sortXML.py} $optionsXML sorted.xml ${pkgs.libxslt.bin}/bin/xsltproc \ + --stringparam documentType '${documentType}' \ --stringparam revision '${revision}' \ -o intermediate.xml ${./options-to-docbook.xsl} sorted.xml ${pkgs.libxslt.bin}/bin/xsltproc \ diff --git a/nixos/lib/make-options-doc/options-to-docbook.xsl b/nixos/lib/make-options-doc/options-to-docbook.xsl index 607db4bb21b..03e14365cda 100644 --- a/nixos/lib/make-options-doc/options-to-docbook.xsl +++ b/nixos/lib/make-options-doc/options-to-docbook.xsl @@ -12,12 +12,25 @@ + - - Configuration Options + + + + Configuration Options + + + + + + + + + +