mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-19 15:11:30 +00:00
buildEnv: use concatMap, avoid piping
This commit is contained in:
@@ -13,6 +13,7 @@ let
|
||||
builder = replaceVars ./builder.pl {
|
||||
inherit (builtins) storeDir;
|
||||
};
|
||||
inherit (lib) concatMap;
|
||||
in
|
||||
|
||||
# Backward compatibility for deprecated custom overrider <env-pkg>.override
|
||||
@@ -127,22 +128,17 @@ lib.makeOverridable (
|
||||
[ drv ]
|
||||
)
|
||||
# Add any extra outputs specified by the caller of `buildEnv`.
|
||||
++ lib.filter (p: p != null) (
|
||||
map (outName: drv.${outName} or null) finalAttrs.extraOutputsToInstall
|
||||
);
|
||||
++ concatMap (
|
||||
outName: if drv ? ${outName} then [ drv.${outName} ] else [ ]
|
||||
) finalAttrs.extraOutputsToInstall;
|
||||
priority = drv.meta.priority or lib.meta.defaultPriority;
|
||||
# Silently use the original `paths` if `passthru.paths` is missing.
|
||||
}) finalAttrs.passthru.paths or paths;
|
||||
|
||||
extraPathsFrom = lib.optionalString finalAttrs.includeClosures (
|
||||
let
|
||||
pathsForClosure = lib.pipe finalAttrs.chosenOutputs [
|
||||
(map (p: p.paths))
|
||||
lib.flatten
|
||||
(lib.remove null)
|
||||
];
|
||||
in
|
||||
writeClosure pathsForClosure
|
||||
# filter all null elements and concatenate the output paths together
|
||||
# in the final closure
|
||||
writeClosure (lib.concatMap (p: if p == null then [ ] else p.paths) finalAttrs.chosenOutputs)
|
||||
);
|
||||
|
||||
preferLocalBuild = derivationArgs.preferLocalBuild or true;
|
||||
|
||||
Reference in New Issue
Block a user