doc: Add Modules, modules.generic.meta-maintainers
This commit is contained in:
@@ -15,12 +15,43 @@
|
|||||||
markdown-code-runner,
|
markdown-code-runner,
|
||||||
roboto,
|
roboto,
|
||||||
treefmt,
|
treefmt,
|
||||||
|
nixosOptionsDoc,
|
||||||
}:
|
}:
|
||||||
stdenvNoCC.mkDerivation (
|
stdenvNoCC.mkDerivation (
|
||||||
finalAttrs:
|
finalAttrs:
|
||||||
let
|
let
|
||||||
inherit (finalAttrs.finalPackage.optionsDoc) optionsJSON;
|
inherit (finalAttrs.finalPackage.optionsDoc) optionsJSON;
|
||||||
inherit (finalAttrs.finalPackage) epub lib-docs pythonInterpreterTable;
|
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
|
in
|
||||||
{
|
{
|
||||||
name = "nixpkgs-manual";
|
name = "nixpkgs-manual";
|
||||||
@@ -49,6 +80,7 @@ stdenvNoCC.mkDerivation (
|
|||||||
ln -s ${optionsJSON}/share/doc/nixos/options.json ./config-options.json
|
ln -s ${optionsJSON}/share/doc/nixos/options.json ./config-options.json
|
||||||
ln -s ${treefmt.functionsDoc.markdown} ./packages/treefmt-functions.section.md
|
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 ${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 = ''
|
buildPhase = ''
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ lib.md
|
|||||||
stdenv.md
|
stdenv.md
|
||||||
toolchains.md
|
toolchains.md
|
||||||
build-helpers.md
|
build-helpers.md
|
||||||
|
modules/index.md
|
||||||
development.md
|
development.md
|
||||||
contributing.md
|
contributing.md
|
||||||
interoperability.md
|
interoperability.md
|
||||||
|
|||||||
16
doc/modules/generic.chapter.md
Normal file
16
doc/modules/generic.chapter.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
# 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
Normal file
12
doc/modules/index.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# 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
|
||||||
@@ -130,6 +130,15 @@
|
|||||||
"minor-ghc-deprecation": [
|
"minor-ghc-deprecation": [
|
||||||
"index.html#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": [
|
"neovim": [
|
||||||
"index.html#neovim"
|
"index.html#neovim"
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user