1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-06-10 10:02:36 +09:00

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.
This commit is contained in:
Emily 2024-12-30 20:09:11 +00:00
parent 3c65f3d846
commit 2eae7d63e2
2 changed files with 19 additions and 14 deletions

View file

@ -90,10 +90,7 @@
stdenvNoCC.mkDerivation { stdenvNoCC.mkDerivation {
name = "nixpkgs-lib-docs"; name = "nixpkgs-lib-docs";
src = lib.fileset.toSource { src = ../../lib;
root = ../..;
fileset = ../../lib;
};
nativeBuildInputs = [ nativeBuildInputs = [
nixdoc nixdoc
@ -101,6 +98,8 @@ stdenvNoCC.mkDerivation {
]; ];
installPhase = '' installPhase = ''
cd ..
export NIX_STATE_DIR=$(mktemp -d) export NIX_STATE_DIR=$(mktemp -d)
nix-instantiate --eval --strict --json ${./lib-function-locations.nix} \ nix-instantiate --eval --strict --json ${./lib-function-locations.nix} \
--arg nixpkgsPath "./." \ --arg nixpkgsPath "./." \

View file

@ -25,16 +25,22 @@ stdenvNoCC.mkDerivation (
nativeBuildInputs = [ nixos-render-docs ]; nativeBuildInputs = [ nixos-render-docs ];
src = lib.fileset.toSource { src = lib.cleanSourceWith {
root = ../.; src = ../.;
fileset = lib.fileset.unions [ filter =
(lib.fileset.fileFilter (file: file.hasExt "md" || file.hasExt "md.in") ../.) path: type:
../style.css type == "directory"
../anchor-use.js || lib.hasSuffix ".md" path
../anchor.min.js || lib.hasSuffix ".md.in" path
../manpage-urls.json || lib.elem path (
../redirects.json map toString [
]; ../style.css
../anchor-use.js
../anchor.min.js
../manpage-urls.json
../redirects.json
]
);
}; };
postPatch = '' postPatch = ''