doc: Add Modules, modules.generic.meta-maintainers

Changed files
+70
doc
+32
doc/doc-support/package.nix
···
markdown-code-runner,
roboto,
treefmt,
+
nixosOptionsDoc,
}:
stdenvNoCC.mkDerivation (
finalAttrs:
let
inherit (finalAttrs.finalPackage.optionsDoc) optionsJSON;
inherit (finalAttrs.finalPackage) epub lib-docs pythonInterpreterTable;
+
+
# Make anything from lib (the module system internals) invisible
+
hide-lib =
+
opt:
+
opt
+
// {
+
visible = if lib.all (decl: decl == "lib/modules.nix") opt.declarations then false else opt.visible;
+
};
+
+
toURL =
+
decl:
+
let
+
declStr = toString decl;
+
root = toString (../..);
+
subpath = lib.removePrefix "/" (lib.removePrefix root declStr);
+
in
+
if lib.hasPrefix root declStr then
+
{
+
url = "https://github.com/NixOS/nixpkgs/blob/master/${subpath}";
+
name = "nixpkgs/${subpath}";
+
}
+
else
+
decl;
+
+
mapURLs = opt: opt // { declarations = map toURL opt.declarations; };
+
+
docs.generic.meta-maintainers = nixosOptionsDoc {
+
inherit (lib.evalModules { modules = [ ../../modules/generic/meta-maintainers.nix ]; }) options;
+
transformOptions = opt: hide-lib (mapURLs opt);
+
};
in
{
name = "nixpkgs-manual";
···
ln -s ${optionsJSON}/share/doc/nixos/options.json ./config-options.json
ln -s ${treefmt.functionsDoc.markdown} ./packages/treefmt-functions.section.md
ln -s ${treefmt.optionsDoc.optionsJSON}/share/doc/nixos/options.json ./treefmt-options.json
+
ln -s ${docs.generic.meta-maintainers.optionsJSON}/share/doc/nixos/options.json ./options-modules-generic-meta-maintainers.json
'';
buildPhase = ''
+1
doc/manual.md.in
···
stdenv.md
toolchains.md
build-helpers.md
+
modules/index.md
development.md
contributing.md
interoperability.md
+16
doc/modules/generic.chapter.md
···
+
+
# Generic {#modules-generic}
+
+
Generic modules can be imported to extend configurations of any [class].
+
+
## `meta-maintainers.nix` {#modules-generic-meta-maintainers}
+
+
The options below become available when using `imports = [ (nixpkgs + "/modules/generic/meta-maintainers.nix") ];`.
+
+
```{=include=} options
+
id-prefix: opt-modules-generic-meta-maintainers-
+
list-id: configuration-variable-list
+
source: ../options-modules-generic-meta-maintainers.json
+
```
+
+
[class]: https://nixos.org/manual/nixpkgs/unstable/#module-system-lib-evalModules-param-class
+12
doc/modules/index.md
···
+
# Modules {#modules}
+
+
The Nixpkgs repository provides [Module System] modules for various purposes.
+
+
The following sections are organized by [module class].
+
+
```{=include=} chapters
+
generic.chapter.md
+
```
+
+
[Module System]: https://nixos.org/manual/nixpkgs/unstable/#module-system
+
[module class]: https://nixos.org/manual/nixpkgs/unstable/#module-system-lib-evalModules-param-class
+9
doc/redirects.json
···
"minor-ghc-deprecation": [
"index.html#minor-ghc-deprecation"
],
+
"modules": [
+
"index.html#modules"
+
],
+
"modules-generic": [
+
"index.html#modules-generic"
+
],
+
"modules-generic-meta-maintainers": [
+
"index.html#modules-generic-meta-maintainers"
+
],
"neovim": [
"index.html#neovim"
],