Revert "nixos/documentation: avoid copying nixpkgs subpaths"

builtins.storePath is not allowed in pure evaluation mode

This reverts commit 1511e72b75.
This commit is contained in:
kraem 2022-01-05 12:36:54 +01:00
parent be52ab786e
commit 893ffee286
No known key found for this signature in database
GPG Key ID: BFFEB7FD4C5359E2

View File

@ -67,15 +67,11 @@ let
(t == "directory" -> baseNameOf n != "tests")
&& (t == "file" -> hasSuffix ".nix" n)
);
pull = dir:
if isStorePath pkgs.path
then "${builtins.storePath pkgs.path}/${dir}"
else filter "${toString pkgs.path}/${dir}";
in
pkgs.runCommand "lazy-options.json" {
libPath = pull "lib";
pkgsLibPath = pull "pkgs/pkgs-lib";
nixosPath = pull "nixos";
libPath = filter "${toString pkgs.path}/lib";
pkgsLibPath = filter "${toString pkgs.path}/pkgs/pkgs-lib";
nixosPath = filter "${toString pkgs.path}/nixos";
modules = map (p: ''"${removePrefix "${modulesPath}/" (toString p)}"'') docModules.lazy;
} ''
export NIX_STORE_DIR=$TMPDIR/store