about summary refs log tree commit diff
path: root/scripts/nix-pull.in
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-11-24T09·25+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-11-24T09·25+0000
commit496934a99ce509ac94a99a938d7d79d1b38461ef (patch)
treefea22a82886aa05f7bf2bc2a96f8274d3692da83 /scripts/nix-pull.in
parentc9cb1fa21f4454a214f4cd62aef2ccc35a8f89af (diff)
* Fix nix-pull.
Diffstat (limited to 'scripts/nix-pull.in')
-rw-r--r--scripts/nix-pull.in36
1 files changed, 15 insertions, 21 deletions
diff --git a/scripts/nix-pull.in b/scripts/nix-pull.in
index 4cb6409d77..ad21b6f8ab 100644
--- a/scripts/nix-pull.in
+++ b/scripts/nix-pull.in
@@ -18,7 +18,6 @@ my @subs;
 my @sucs;
 
 my $fullexpr = "[";
-my $first = 1;
 
 open CONFFILE, "<$conffile";
 
@@ -63,20 +62,15 @@ while (<CONFFILE>) {
                     my $fullurl = "$url/$narname";
                     print "$storepath\n";
 
-                    # Construct a Fix expression that fetches and unpacks a
+                    # Construct a Nix expression that fetches and unpacks a
                     # Nix archive from the network.
                     my $fetch =
-                        "App(IncludeFix(\"fetchurl/fetchurl.fix\"), " .
-                        "[(\"url\", \"$fullurl\"), (\"md5\", \"$hash\")])";
-                    my $fixexpr = 
-                        "App(IncludeFix(\"nar/unnar.fix\"), " .
-                        "[ (\"nar\", $fetch)" .
-                        ", (\"outPath\", \"$storepath\")" .
-                        "])";
-                    
-                    if (!$first) { $fullexpr .= "," };
-                    $first = 0;
-                    $fullexpr .= $fixexpr; # !!! O(n^2)?
+                        "(import @datadir@/nix/corepkgs/fetchurl) " .
+                        "{url = $fullurl; md5 = \"$hash\"; system = \"@host@\"}";
+                    my $nixexpr =
+                        "((import @datadir@/nix/corepkgs/nar/unnar.nix) " .
+                        "{narFile = ($fetch); outPath = \"$storepath\"; system = \"@host@\"}) ";
+                    $fullexpr .= $nixexpr; # !!! O(n^2)?
 
                     push @srcpaths, $storepath;
 
@@ -110,9 +104,9 @@ while (<CONFFILE>) {
 $fullexpr .= "]";
 
 
-# Instantiate Nix expressions from the Fix expressions we created above.
-print STDERR "running fix...\n";
-my $pid = open2(\*READ, \*WRITE, "fix -") or die "cannot run fix";
+# Instantiate store expressions from the Nix expressions we created above.
+print STDERR "instantiating Nix expression...\n";
+my $pid = open2(\*READ, \*WRITE, "nix-instantiate -") or die "cannot run nix-instantiate";
 
 print WRITE $fullexpr;
 close WRITE;
@@ -128,16 +122,16 @@ while (<READ>) {
 }
 
 waitpid $pid, 0;
-$? == 0 or die "fix failed";
+$? == 0 or die "nix-instantiate failed";
 
 
 # Register all substitutes.
 print STDERR "registering substitutes...\n";
-system "nix --substitute @subs";
-if ($?) { die "`nix --substitute' failed"; }
+system "nix-store --substitute @subs";
+if ($?) { die "`nix-store --substitute' failed"; }
 
 
 # Register all successors.
 print STDERR "registering successors...\n";
-system "nix --successor @sucs";
-if ($?) { die "`nix --successor' failed"; }
+system "nix-store --successor @sucs";
+if ($?) { die "`nix-store --successor' failed"; }