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

Changed files
+70
doc
+32
doc/doc-support/package.nix
··· 15 15 markdown-code-runner, 16 16 roboto, 17 17 treefmt, 18 + nixosOptionsDoc, 18 19 }: 19 20 stdenvNoCC.mkDerivation ( 20 21 finalAttrs: 21 22 let 22 23 inherit (finalAttrs.finalPackage.optionsDoc) optionsJSON; 23 24 inherit (finalAttrs.finalPackage) epub lib-docs pythonInterpreterTable; 25 + 26 + # Make anything from lib (the module system internals) invisible 27 + hide-lib = 28 + opt: 29 + opt 30 + // { 31 + visible = if lib.all (decl: decl == "lib/modules.nix") opt.declarations then false else opt.visible; 32 + }; 33 + 34 + toURL = 35 + decl: 36 + let 37 + declStr = toString decl; 38 + root = toString (../..); 39 + subpath = lib.removePrefix "/" (lib.removePrefix root declStr); 40 + in 41 + if lib.hasPrefix root declStr then 42 + { 43 + url = "https://github.com/NixOS/nixpkgs/blob/master/${subpath}"; 44 + name = "nixpkgs/${subpath}"; 45 + } 46 + else 47 + decl; 48 + 49 + mapURLs = opt: opt // { declarations = map toURL opt.declarations; }; 50 + 51 + docs.generic.meta-maintainers = nixosOptionsDoc { 52 + inherit (lib.evalModules { modules = [ ../../modules/generic/meta-maintainers.nix ]; }) options; 53 + transformOptions = opt: hide-lib (mapURLs opt); 54 + }; 24 55 in 25 56 { 26 57 name = "nixpkgs-manual"; ··· 49 80 ln -s ${optionsJSON}/share/doc/nixos/options.json ./config-options.json 50 81 ln -s ${treefmt.functionsDoc.markdown} ./packages/treefmt-functions.section.md 51 82 ln -s ${treefmt.optionsDoc.optionsJSON}/share/doc/nixos/options.json ./treefmt-options.json 83 + ln -s ${docs.generic.meta-maintainers.optionsJSON}/share/doc/nixos/options.json ./options-modules-generic-meta-maintainers.json 52 84 ''; 53 85 54 86 buildPhase = ''
+1
doc/manual.md.in
··· 11 11 stdenv.md 12 12 toolchains.md 13 13 build-helpers.md 14 + modules/index.md 14 15 development.md 15 16 contributing.md 16 17 interoperability.md
+16
doc/modules/generic.chapter.md
··· 1 + 2 + # Generic {#modules-generic} 3 + 4 + Generic modules can be imported to extend configurations of any [class]. 5 + 6 + ## `meta-maintainers.nix` {#modules-generic-meta-maintainers} 7 + 8 + The options below become available when using `imports = [ (nixpkgs + "/modules/generic/meta-maintainers.nix") ];`. 9 + 10 + ```{=include=} options 11 + id-prefix: opt-modules-generic-meta-maintainers- 12 + list-id: configuration-variable-list 13 + source: ../options-modules-generic-meta-maintainers.json 14 + ``` 15 + 16 + [class]: https://nixos.org/manual/nixpkgs/unstable/#module-system-lib-evalModules-param-class
+12
doc/modules/index.md
··· 1 + # Modules {#modules} 2 + 3 + The Nixpkgs repository provides [Module System] modules for various purposes. 4 + 5 + The following sections are organized by [module class]. 6 + 7 + ```{=include=} chapters 8 + generic.chapter.md 9 + ``` 10 + 11 + [Module System]: https://nixos.org/manual/nixpkgs/unstable/#module-system 12 + [module class]: https://nixos.org/manual/nixpkgs/unstable/#module-system-lib-evalModules-param-class
+9
doc/redirects.json
··· 130 130 "minor-ghc-deprecation": [ 131 131 "index.html#minor-ghc-deprecation" 132 132 ], 133 + "modules": [ 134 + "index.html#modules" 135 + ], 136 + "modules-generic": [ 137 + "index.html#modules-generic" 138 + ], 139 + "modules-generic-meta-maintainers": [ 140 + "index.html#modules-generic-meta-maintainers" 141 + ], 133 142 "neovim": [ 134 143 "index.html#neovim" 135 144 ],