about summary refs log tree commit diff
path: root/scripts/nix-prefetch-url.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/nix-prefetch-url.in')
-rw-r--r--scripts/nix-prefetch-url.in8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/nix-prefetch-url.in b/scripts/nix-prefetch-url.in
index 6a90e787c3f5..45b3ed7ee75c 100644
--- a/scripts/nix-prefetch-url.in
+++ b/scripts/nix-prefetch-url.in
@@ -25,13 +25,17 @@ test -e $tmpPath2 || mv $tmpPath1 $tmpPath2 # !!! race
 storeExpr=$( \
   echo "(import @datadir@/nix/corepkgs/fetchurl) \
         {url = $url; md5 = \"$hash\"; system = \"@system@\";}" \
-  | nix-instantiate -)
+  | @bindir@/nix-instantiate -)
 
 # Realise it.
-finalPath=$(nix-store -qnB --force-realise $storeExpr)
+finalPath=$(@bindir@/nix-store -qnB --force-realise $storeExpr)
 
 echo "path is $finalPath" >&2
 
 rm -rf $tmpPath2 || true
 
 echo $hash
+
+if test -n "$PRINT_PATH"; then
+    echo $finalPath
+fi