{ pkgs, inputs }: let inherit (pkgs.lib) hasPrefix removePrefix; in pkgs.nixosOptionsDoc { inherit (pkgs.lib.evalModules { modules = [ "${inputs.nixpkgs.outPath}/pkgs/top-level/config.nix" ]; class = "nixpkgsConfig"; }) 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; }; }