From e40d2099d235f80aa3444b7a76028c0b7725a549 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 1 May 2022 21:43:10 +0200 Subject: [PATCH] doc: Add Nixpkgs config options reference --- doc/doc-support/default.nix | 9 +++++++++ doc/using/configuration.chapter.md | 8 ++++++++ pkgs/top-level/config.nix | 5 +++++ 3 files changed, 22 insertions(+) diff --git a/doc/doc-support/default.nix b/doc/doc-support/default.nix index 53990b677196..7c00195ab390 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 932b24237c02..842450ebf47f 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/pkgs/top-level/config.nix b/pkgs/top-level/config.nix index 1ee44a47af9f..24f7aa6d0b04 100644 --- a/pkgs/top-level/config.nix +++ b/pkgs/top-level/config.nix @@ -20,6 +20,11 @@ let /* Internal stuff */ + # Hide built-in module system options from docs. + _module.args = mkOption { + internal = true; + }; + warnings = mkOption { type = types.listOf types.str; default = [];