From 1e33a71c903625072ab2df964bb2d9e1291cecd0 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sat, 16 Aug 2008 18:48:50 +0000 Subject: [PATCH] A small function not unlike symlinkJoin. svn path=/nixpkgs/trunk/; revision=12641 --- pkgs/top-level/all-packages.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b4261d26b708..b45f98f54f2b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -404,6 +404,10 @@ let pkgs = rec { symlinkJoin = name: paths: runCommand name {inherit paths;} "mkdir -p $out; for i in $paths; do ${xorg.lndir}/bin/lndir $i $out; done"; + # entries is a list of attribute sets like { name = "name" ; path = "/nix/store/..."; } + linkFarm = name: entries: runCommand name {} ("mkdir -p $out; cd $out; \n" + + (lib.concatMapStrings (x: "ln -s '${x.path}' '${x.name}';\n") entries)); + substituteAll = import ../build-support/substitute/substitute-all.nix { inherit stdenv; };