doc/lib-functions: preserve libsets order

This commit is contained in:
Naïm Favier 2022-12-12 12:21:59 +01:00
parent e1bb8f1e74
commit ce952286ca
No known key found for this signature in database
GPG Key ID: 95AFCE8211908325
3 changed files with 16 additions and 16 deletions

View File

@ -3,19 +3,19 @@ let
inherit (pkgs) lib;
inherit (lib) hasPrefix removePrefix;
libsets = {
asserts = "Assert functions";
attrsets = "Attribute-set functions";
strings = "String manipulation functions";
versions = "Version string functions";
trivial = "Miscellaneous functions";
lists = "List manipulation functions";
debug = "Debugging functions";
options = "NixOS / nixpkgs option handling";
filesystem = "Filesystem functions";
sources = "Source filtering functions";
cli = "Command-line serialization functions";
};
libsets = [
{ name = "asserts"; description = "Assert functions"; }
{ name = "attrsets"; description = "Attribute-set functions"; }
{ name = "strings"; description = "String manipulation functions"; }
{ name = "versions"; description = "Version string functions"; }
{ name = "trivial"; description = "Miscellaneous functions"; }
{ name = "lists"; description = "List manipulation functions"; }
{ name = "debug"; description = "Debugging functions"; }
{ name = "options"; description = "NixOS / nixpkgs option handling"; }
{ name = "filesystem"; description = "Filesystem functions"; }
{ name = "sources"; description = "Source filtering functions"; }
{ name = "cli"; description = "Command-line serialization functions"; }
];
locationsXml = import ./lib-function-locations.nix { inherit pkgs nixpkgs libsets; };
functionDocs = import ./lib-function-docs.nix { inherit locationsXml pkgs libsets; };

View File

@ -20,9 +20,9 @@ with pkgs; stdenv.mkDerivation {
<root xmlns:xi="http://www.w3.org/2001/XInclude">
EOF
${lib.concatStrings (lib.mapAttrsToList (name: description: ''
${lib.concatMapStrings ({ name, description }: ''
docgen ${name} ${lib.escapeShellArg description}
'') libsets)}
'') libsets}
echo "</root>" >> "$out/index.xml"

View File

@ -16,7 +16,7 @@ let
subsetname = subsetname;
functions = libDefPos toplib.${subsetname};
})
(builtins.attrNames libsets);
(builtins.map (x: x.name) libsets);
nixpkgsLib = pkgs.lib;