diff --git a/doc/doc-support/lib-function-docs.nix b/doc/doc-support/lib-function-docs.nix index 51b4601975c3..9a2f0667dd60 100644 --- a/doc/doc-support/lib-function-docs.nix +++ b/doc/doc-support/lib-function-docs.nix @@ -90,10 +90,7 @@ stdenvNoCC.mkDerivation { name = "nixpkgs-lib-docs"; - src = lib.fileset.toSource { - root = ../..; - fileset = ../../lib; - }; + src = ../../lib; nativeBuildInputs = [ nixdoc @@ -101,6 +98,8 @@ stdenvNoCC.mkDerivation { ]; installPhase = '' + cd .. + export NIX_STATE_DIR=$(mktemp -d) nix-instantiate --eval --strict --json ${./lib-function-locations.nix} \ --arg nixpkgsPath "./." \ diff --git a/doc/doc-support/package.nix b/doc/doc-support/package.nix index c2bbdf09e533..bc5566f3cbd3 100644 --- a/doc/doc-support/package.nix +++ b/doc/doc-support/package.nix @@ -25,16 +25,22 @@ stdenvNoCC.mkDerivation ( 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 = ''