1 { pkgs ? (import ./.. { }), nixpkgs ? { }}:
3 revision = pkgs.lib.trivial.revisionWithDefault (nixpkgs.revision or "master");
9 location = builtins.unsafeGetAttrPos name set;
11 (builtins.attrNames set);
16 subsetname = subsetname;
17 functions = libDefPos toplib.${subsetname};
20 (name: builtins.isAttrs toplib.${name})
21 (builtins.attrNames toplib));
23 nixpkgsLib = pkgs.lib;
25 flattenedLibSubset = { subsetname, functions }:
28 name = "lib.${subsetname}.${fn.name}";
33 locatedlibsets = libs: builtins.map flattenedLibSubset (libset libs);
34 removeFilenamePrefix = prefix: filename:
36 prefixLen = (builtins.stringLength prefix) + 1; # +1 to remove the leading /
37 filenameLen = builtins.stringLength filename;
38 substr = builtins.substring prefixLen filenameLen filename;
41 removeNixpkgs = removeFilenamePrefix (builtins.toString pkgs.path);
45 (elem: elem.value != null)
46 (nixpkgsLib.lists.flatten
47 (locatedlibsets nixpkgsLib));
49 fnLocationRelative = { name, value }:
52 value = value // { file = removeNixpkgs value.file; };
55 relativeLocs = (builtins.map fnLocationRelative liblocations);
56 sanitizeId = builtins.replaceStrings
60 urlPrefix = "https://github.com/NixOS/nixpkgs/blob/${revision}";
61 xmlstrings = (nixpkgsLib.strings.concatMapStrings
64 <section><title>${name}</title>
65 <para xml:id="${sanitizeId name}">
68 xlink:href="${urlPrefix}/${value.file}#L${builtins.toString value.line}">${value.file}:${builtins.toString value.line}</link>
69 in <literal><nixpkgs></literal>.
78 <section xmlns="http://docbook.org/ns/docbook"
79 xmlns:xlink="http://www.w3.org/1999/xlink"
81 <title>All the locations for every lib function</title>
82 <para>This file is only for inclusion by other files.</para>