mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-09-29 07:32:58 +00:00
nixos/documentation: avoid copying nixpkgs subpaths, iteration 2
This kind of reverts commit 893ffee286
.
This commit is contained in:
parent
813f9da8ab
commit
15a00be189
@ -67,11 +67,19 @@ let
|
|||||||
(t == "directory" -> baseNameOf n != "tests")
|
(t == "directory" -> baseNameOf n != "tests")
|
||||||
&& (t == "file" -> hasSuffix ".nix" n)
|
&& (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
|
in
|
||||||
pkgs.runCommand "lazy-options.json" {
|
pkgs.runCommand "lazy-options.json" {
|
||||||
libPath = filter "${toString pkgs.path}/lib";
|
libPath = pull "lib";
|
||||||
pkgsLibPath = filter "${toString pkgs.path}/pkgs/pkgs-lib";
|
pkgsLibPath = pull "pkgs/pkgs-lib";
|
||||||
nixosPath = filter "${toString pkgs.path}/nixos";
|
nixosPath = pull "nixos";
|
||||||
modules = map (p: ''"${removePrefix "${modulesPath}/" (toString p)}"'') docModules.lazy;
|
modules = map (p: ''"${removePrefix "${modulesPath}/" (toString p)}"'') docModules.lazy;
|
||||||
} ''
|
} ''
|
||||||
export NIX_STORE_DIR=$TMPDIR/store
|
export NIX_STORE_DIR=$TMPDIR/store
|
||||||
|
Loading…
Reference in New Issue
Block a user