diff --git a/helpers/make-iso9660-image.sh b/helpers/make-iso9660-image.sh index 6ce205adc2af..00ce36b8a77e 100644 --- a/helpers/make-iso9660-image.sh +++ b/helpers/make-iso9660-image.sh @@ -26,6 +26,10 @@ for i in $storePaths; do done +# Also put a nix-pull manifest of the closures on the CD. +printManifest=1 perl $pathsFromGraph closure-* > MANIFEST + + # Add symlinks to the top-level store objects. for ((n = 0; n < ${#objects[*]}; n++)); do object=${objects[$n]} diff --git a/helpers/paths-from-graph.pl b/helpers/paths-from-graph.pl index a4faa36d00f4..522c86be2d9f 100644 --- a/helpers/paths-from-graph.pl +++ b/helpers/paths-from-graph.pl @@ -1,6 +1,7 @@ use strict; my %storePaths; +my %refs; foreach my $graph (@ARGV) { open GRAPH, "<$graph" or die; @@ -13,14 +14,39 @@ foreach my $graph (@ARGV) { my $deriver = ; chomp $deriver; my $count = ; chomp $count; + my @refs = (); for (my $i = 0; $i < $count; ++$i) { - my $ref = ; + my $ref = ; chomp $ref; + push @refs, $ref; } + $refs{$storePath} = \@refs; + } close GRAPH; } -foreach my $storePath (sort (keys %storePaths)) { - print "$storePath\n"; + +if ($ENV{"printManifest"} eq "1") { + print "version {\n"; + print " ManifestVersion: 3\n"; + print "}\n"; + + foreach my $storePath (sort (keys %storePaths)) { + print "{\n"; + print " StorePath: $storePath\n"; + print " CopyFrom: /tmp/inst-store$storePath\n"; + print " References: "; + foreach my $ref (@{$refs{$storePath}}) { + print "$ref "; + } + print "\n"; + print "}\n"; + } +} + +else { + foreach my $storePath (sort (keys %storePaths)) { + print "$storePath\n"; + } } diff --git a/system/system.nix b/system/system.nix index 4f272d8d7a5b..7587c7fa8318 100644 --- a/system/system.nix +++ b/system/system.nix @@ -111,7 +111,7 @@ rec { # The installer. nixosInstaller = import ../installer/nixos-installer.nix { - inherit (pkgs) stdenv runCommand substituteAll; + inherit (pkgs) stdenv perl runCommand substituteAll; inherit nix; nixpkgsURL = config.get ["installer" "nixpkgsURL"]; };