nixpkgs-manual: avoid `lib.fileset`

I don’t love this, and I’m not convinced it doesn’t have the
same pitfalls as filesets, but see the `flattenReferencesGraph`
commit for reasoning.

It may be better to ban the relevant builtins entirely and just move
things into subdirectories when needed, but I didn’t want to do
more surgery to this part of the tree than necessary to solve the
immediate problem.

Emily 2eae7d63 3c65f3d8

Changed files
+19 -14
doc
+3 -4
doc/doc-support/lib-function-docs.nix
···
stdenvNoCC.mkDerivation {
name = "nixpkgs-lib-docs";
-
src = lib.fileset.toSource {
-
root = ../..;
-
fileset = ../../lib;
-
};
+
src = ../../lib;
nativeBuildInputs = [
nixdoc
···
];
installPhase = ''
+
cd ..
+
export NIX_STATE_DIR=$(mktemp -d)
nix-instantiate --eval --strict --json ${./lib-function-locations.nix} \
--arg nixpkgsPath "./." \
+16 -10
doc/doc-support/package.nix
···
nativeBuildInputs = [ nixos-render-docs ];
-
src = lib.fileset.toSource {
-
root = ../.;
-
fileset = lib.fileset.unions [
-
(lib.fileset.fileFilter (file: file.hasExt "md" || file.hasExt "md.in") ../.)
-
../style.css
-
../anchor-use.js
-
../anchor.min.js
-
../manpage-urls.json
-
../redirects.json
-
];
+
src = lib.cleanSourceWith {
+
src = ../.;
+
filter =
+
path: type:
+
type == "directory"
+
|| lib.hasSuffix ".md" path
+
|| lib.hasSuffix ".md.in" path
+
|| lib.elem path (
+
map toString [
+
../style.css
+
../anchor-use.js
+
../anchor.min.js
+
../manpage-urls.json
+
../redirects.json
+
]
+
);
};
postPatch = ''