summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/build-support/trivial-builders.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix
index f9816b2d0d7c..d2acc2679afa 100644
--- a/pkgs/build-support/trivial-builders.nix
+++ b/pkgs/build-support/trivial-builders.nix
@@ -145,7 +145,10 @@ rec {
   # entries is a list of attribute sets like { name = "name" ; path = "/nix/store/..."; }
   linkFarm = name: entries: runCommand name { preferLocalBuild = true; }
     ("mkdir -p $out; cd $out; \n" +
-      (lib.concatMapStrings (x: "ln -s '${x.path}' '${x.name}';\n") entries));
+      (lib.concatMapStrings (x: ''
+        mkdir -p "$(dirname '${x.name}')"
+        ln -s '${x.path}' '${x.name}'
+      '') entries));
 
 
   # Print an error message if the file with the specified name and