Revert "nixos/documentation: avoid copying nixpkgs subpaths, iteration 2"

This reverts commit 15a00be189.
This commit is contained in:
Robert Hensing 2022-01-27 12:33:16 +01:00
parent 647b304306
commit aa877346f8

View file

@ -67,19 +67,11 @@ let
(t == "directory" -> baseNameOf n != "tests")
&& (t == "file" -> hasSuffix ".nix" n)
);
# When working directly from a checkout,
# produce separate, smaller store paths
# When already in the store,
# avoid copying; reuse the whole nixpkgs sources
pull = dir:
if isStorePath pkgs.path
then "${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