symlinkJoin: truly pass the defaulted parameters

The catch is that in nix the @-pattern binds the set that was *explicitly*
passed to the function, i.e. default values are *not* taken into account.
This commit is contained in:
Vladimír Čunát 2016-07-14 15:30:30 +02:00
parent efe4d48e8e
commit ab9515092b

View File

@ -49,15 +49,17 @@ rec {
# Create a forest of symlinks to the files in `paths'. # Create a forest of symlinks to the files in `paths'.
symlinkJoin = symlinkJoin =
args@{ name args_@{ name
, paths , paths
, preferLocalBuild ? true , preferLocalBuild ? true
, allowSubstitutes ? false , allowSubstitutes ? false
, postBuild ? "" , postBuild ? ""
, ... , ...
}: }:
runCommand name let
(removeAttrs args [ "name" "postBuild" ]) args = removeAttrs args_ [ "name" "postBuild" ]
// { inherit preferLocalBuild allowSubstitutes; }; # pass the defaults
in runCommand name args
'' ''
mkdir -p $out mkdir -p $out
for i in $paths; do for i in $paths; do