doc/lib-functions: remove warnings

Building the nixpkgs manual currently triggers a bunch of deprecation
warnings, because every attribute in `lib` is evaluated to see if it's
an attrset to generate locations for.

Instead, share the lib subsets to include in the documentation
between `lib-function-docs` and `lib-function-locations` so they can
coordinate.

Also generate the list of sections instead of duplicating it in
`library.xml`.
This commit is contained in:
Naïm Favier 2022-12-11 15:56:09 +01:00
parent cd39b90b6f
commit 8906aa28e4
No known key found for this signature in database
GPG key ID: 95AFCE8211908325
5 changed files with 38 additions and 44 deletions

View file

@ -1,4 +1,4 @@
{ pkgs ? (import ./.. { }), nixpkgs ? { }}:
{ pkgs, nixpkgs ? { }, libsets }:
let
revision = pkgs.lib.trivial.revisionWithDefault (nixpkgs.revision or "master");
@ -16,9 +16,7 @@ let
subsetname = subsetname;
functions = libDefPos toplib.${subsetname};
})
(builtins.filter
(name: builtins.isAttrs toplib.${name})
(builtins.attrNames toplib));
(builtins.attrNames libsets);
nixpkgsLib = pkgs.lib;