about summary refs log tree commit diff
path: root/corepkgs/nar
diff options
context:
space:
mode:
Diffstat (limited to 'corepkgs/nar')
-rw-r--r--corepkgs/nar/Makefile.am13
-rw-r--r--corepkgs/nar/nar.fix8
-rw-r--r--corepkgs/nar/nar.nix6
-rw-r--r--corepkgs/nar/nar.sh.in2
-rw-r--r--corepkgs/nar/unnar.fix9
-rw-r--r--corepkgs/nar/unnar.nix7
-rw-r--r--corepkgs/nar/unnar.sh.in2
7 files changed, 22 insertions, 25 deletions
diff --git a/corepkgs/nar/Makefile.am b/corepkgs/nar/Makefile.am
index e369d29c5856..3e0aab869ddf 100644
--- a/corepkgs/nar/Makefile.am
+++ b/corepkgs/nar/Makefile.am
@@ -1,12 +1,13 @@
 all-local: nar.sh unnar.sh
 
 install-exec-local:
-	$(INSTALL) -d $(datadir)/fix/nar
-	$(INSTALL_DATA) nar.fix $(datadir)/fix/nar
-	$(INSTALL_PROGRAM) nar.sh $(datadir)/fix/nar
-	$(INSTALL_DATA) unnar.fix $(datadir)/fix/nar
-	$(INSTALL_PROGRAM) unnar.sh $(datadir)/fix/nar
+	$(INSTALL) -d $(datadir)/nix/corepkgs
+	$(INSTALL) -d $(datadir)/nix/corepkgs/nar
+	$(INSTALL_DATA) nar.nix $(datadir)/nix/corepkgs/nar
+	$(INSTALL_PROGRAM) nar.sh $(datadir)/nix/corepkgs/nar
+	$(INSTALL_DATA) unnar.nix $(datadir)/nix/corepkgs/nar
+	$(INSTALL_PROGRAM) unnar.sh $(datadir)/nix/corepkgs/nar
 
 include ../../substitute.mk
 
-EXTRA_DIST = nar.fix nar.sh.in unnar.fix unnar.sh.in
+EXTRA_DIST = nar.nix nar.sh.in unnar.nix unnar.sh.in
diff --git a/corepkgs/nar/nar.fix b/corepkgs/nar/nar.fix
deleted file mode 100644
index 429e7b5497a3..000000000000
--- a/corepkgs/nar/nar.fix
+++ /dev/null
@@ -1,8 +0,0 @@
-Function(["path"],
-  Package(
-    [ ("name", "nar")
-    , ("build", Relative("nar/nar.sh"))
-    , ("path", Var("path"))
-    ]
-  )
-)
\ No newline at end of file
diff --git a/corepkgs/nar/nar.nix b/corepkgs/nar/nar.nix
new file mode 100644
index 000000000000..f288e0ed49e6
--- /dev/null
+++ b/corepkgs/nar/nar.nix
@@ -0,0 +1,6 @@
+{system, path}: derivation {
+  name = "nar";
+  builder = ./nar.sh;
+  system = system;
+  path = path;
+}
diff --git a/corepkgs/nar/nar.sh.in b/corepkgs/nar/nar.sh.in
index c92ef8e25a8d..8d3fdb51b283 100644
--- a/corepkgs/nar/nar.sh.in
+++ b/corepkgs/nar/nar.sh.in
@@ -5,7 +5,7 @@ export PATH=/bin:/usr/bin
 echo "packing $path into $out..."
 mkdir $out || exit 1
 dst=$out/`basename $path`.nar.bz2
-@bindir@/nix --dump "$path" | bzip2 > $dst || exit 1
+@bindir@/nix-store --dump "$path" | bzip2 > $dst || exit 1
 
 md5=$(md5sum -b $dst | cut -c1-32)
 if test $? != 0; then exit 1; fi
diff --git a/corepkgs/nar/unnar.fix b/corepkgs/nar/unnar.fix
deleted file mode 100644
index cd5079e50a05..000000000000
--- a/corepkgs/nar/unnar.fix
+++ /dev/null
@@ -1,9 +0,0 @@
-Function(["nar", "outPath"],
-  Package(
-    [ ("name", "unnar")
-    , ("outPath", Var("outPath"))
-    , ("build", Relative("nar/unnar.sh"))
-    , ("nar", Var("nar"))
-    ]
-  )
-)
\ No newline at end of file
diff --git a/corepkgs/nar/unnar.nix b/corepkgs/nar/unnar.nix
new file mode 100644
index 000000000000..a18e499b24f7
--- /dev/null
+++ b/corepkgs/nar/unnar.nix
@@ -0,0 +1,7 @@
+{system, narFile, outPath}: derivation {
+  name = "unnar";
+  builder = ./unnar.sh;
+  system = system;
+  narFile = narFile;
+  outPath = outPath;
+}
diff --git a/corepkgs/nar/unnar.sh.in b/corepkgs/nar/unnar.sh.in
index 8a4532af369e..3081356497fa 100644
--- a/corepkgs/nar/unnar.sh.in
+++ b/corepkgs/nar/unnar.sh.in
@@ -3,4 +3,4 @@
 export PATH=/bin:/usr/bin
 
 echo "unpacking $nar to $out..."
-bunzip2 < $nar | @bindir@/nix --restore "$out" || exit 1
+bunzip2 < $nar | @bindir@/nix-store --restore "$out" || exit 1