From b54257fb36b7d2c05778e6ff177dffad965186f4 Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Sat, 23 Apr 2022 21:04:34 -0700 Subject: [PATCH] linkFarm: add entries to passthru --- pkgs/build-support/trivial-builders.nix | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix index e73cb9c5decb..31313a30fa13 100644 --- a/pkgs/build-support/trivial-builders.nix +++ b/pkgs/build-support/trivial-builders.nix @@ -475,14 +475,18 @@ rec { * * See the note on symlinkJoin for the difference between linkFarm and symlinkJoin. */ - linkFarm = name: entries: runCommand name { preferLocalBuild = true; allowSubstitutes = false; } - ''mkdir -p $out - cd $out - ${lib.concatMapStrings (x: '' - mkdir -p "$(dirname ${lib.escapeShellArg x.name})" - ln -s ${lib.escapeShellArg "${x.path}"} ${lib.escapeShellArg x.name} - '') entries} - ''; + linkFarm = name: entries: runCommand name { + preferLocalBuild = true; + allowSubstitutes = false; + passthru = lib.listToAttrs (map (x: lib.nameValuePair x.name x.path) entries); + } '' + mkdir -p $out + cd $out + ${lib.concatMapStrings (x: '' + mkdir -p "$(dirname ${lib.escapeShellArg x.name})" + ln -s ${lib.escapeShellArg "${x.path}"} ${lib.escapeShellArg x.name} + '') entries} + ''; /* * Easily create a linkFarm from a set of derivations.