diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2022-06-22 18:02:10 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-22 18:02:10 +0000 |
commit | 9a2405d6575c2026a994e24529958491feb5d4ce (patch) | |
tree | 82e0ae01796b64386db1eed0b40e9aa14e3a2e52 /doc | |
parent | 8942163bfed6b4e8263e7807b5150ab83820ac93 (diff) | |
parent | ced13075602eb382cf075e340e030d4c989253f4 (diff) |
Merge staging-next into staging
Diffstat (limited to 'doc')
-rw-r--r-- | doc/doc-support/default.nix | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/doc-support/default.nix b/doc/doc-support/default.nix index 7c00195ab3909..429c7a5fbe800 100644 --- a/doc/doc-support/default.nix +++ b/doc/doc-support/default.nix @@ -1,5 +1,8 @@ { pkgs ? (import ../.. {}), nixpkgs ? { }}: let + inherit (pkgs) lib; + inherit (lib) hasPrefix removePrefix; + locationsXml = import ./lib-function-locations.nix { inherit pkgs nixpkgs; }; functionDocs = import ./lib-function-docs.nix { inherit locationsXml pkgs; }; version = pkgs.lib.version; @@ -29,6 +32,18 @@ let optionsDoc = pkgs.nixosOptionsDoc { inherit (pkgs.lib.evalModules { modules = [ ../../pkgs/top-level/config.nix ]; }) options; 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" {} |