about summary refs log tree commit diff
path: root/corepkgs
diff options
context:
space:
mode:
Diffstat (limited to 'corepkgs')
-rw-r--r--corepkgs/nar/nar.fix4
-rw-r--r--corepkgs/nar/nar.sh.in7
2 files changed, 8 insertions, 3 deletions
diff --git a/corepkgs/nar/nar.fix b/corepkgs/nar/nar.fix
index 3db6a48a0838..429e7b5497a3 100644
--- a/corepkgs/nar/nar.fix
+++ b/corepkgs/nar/nar.fix
@@ -1,6 +1,6 @@
-Function(["path", "name"],
+Function(["path"],
   Package(
-    [ ("name", Var("name"))
+    [ ("name", "nar")
     , ("build", Relative("nar/nar.sh"))
     , ("path", Var("path"))
     ]
diff --git a/corepkgs/nar/nar.sh.in b/corepkgs/nar/nar.sh.in
index bffbbaf5e1df..d21668553777 100644
--- a/corepkgs/nar/nar.sh.in
+++ b/corepkgs/nar/nar.sh.in
@@ -1,5 +1,10 @@
 #! /bin/sh
 
 echo "packing $path into $out..."
-@bindir@/nix --dump --file "$path" | bzip2 > $out || exit 1
+mkdir $out || exit 1
+tmp=$out/tmp
+@bindir@/nix --dump --path "$path" | bzip2 > $out/tmp || exit 1
 
+md5=$(md5sum -b $tmp | cut -c1-32)
+if test $? != 0; then exit 1; fi
+mv $out/tmp $out/$md5-`basename $path`.nar.bz2 || exit 1