doc: Fix config options reference file links
This commit is contained in:
parent
cee66a8cd5
commit
11b33fcdcc
|
@ -1,5 +1,8 @@
|
||||||
{ pkgs ? (import ../.. {}), nixpkgs ? { }}:
|
{ pkgs ? (import ../.. {}), nixpkgs ? { }}:
|
||||||
let
|
let
|
||||||
|
inherit (pkgs) lib;
|
||||||
|
inherit (lib) hasPrefix removePrefix;
|
||||||
|
|
||||||
locationsXml = import ./lib-function-locations.nix { inherit pkgs nixpkgs; };
|
locationsXml = import ./lib-function-locations.nix { inherit pkgs nixpkgs; };
|
||||||
functionDocs = import ./lib-function-docs.nix { inherit locationsXml pkgs; };
|
functionDocs = import ./lib-function-docs.nix { inherit locationsXml pkgs; };
|
||||||
version = pkgs.lib.version;
|
version = pkgs.lib.version;
|
||||||
|
@ -29,6 +32,18 @@ let
|
||||||
optionsDoc = pkgs.nixosOptionsDoc {
|
optionsDoc = pkgs.nixosOptionsDoc {
|
||||||
inherit (pkgs.lib.evalModules { modules = [ ../../pkgs/top-level/config.nix ]; }) options;
|
inherit (pkgs.lib.evalModules { modules = [ ../../pkgs/top-level/config.nix ]; }) options;
|
||||||
documentType = "none";
|
documentType = "none";
|
||||||
|
transformOptions = opt:
|
||||||
|
opt // {
|
||||||
|
declarations =
|
||||||
|
map
|
||||||
|
(decl:
|
||||||
|
if hasPrefix (toString ../..) (toString decl)
|
||||||
|
then
|
||||||
|
let subpath = removePrefix "/" (removePrefix (toString ../..) (toString decl));
|
||||||
|
in { url = "https://github.com/NixOS/nixpkgs/blob/master/${subpath}"; name = subpath; }
|
||||||
|
else decl)
|
||||||
|
opt.declarations;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
in pkgs.runCommand "doc-support" {}
|
in pkgs.runCommand "doc-support" {}
|
||||||
|
|
Loading…
Reference in a new issue