* Register everything in the Nix store on the installation CD as a
substitute to speed up installation. svn path=/nixos/trunk/; revision=7783
This commit is contained in:
parent
c56d3a8ce4
commit
241b28d101
@ -1,4 +1,5 @@
|
|||||||
use strict;
|
use strict;
|
||||||
|
use File::Basename;
|
||||||
|
|
||||||
my %storePaths;
|
my %storePaths;
|
||||||
my %refs;
|
my %refs;
|
||||||
@ -33,9 +34,10 @@ if ($ENV{"printManifest"} eq "1") {
|
|||||||
print "}\n";
|
print "}\n";
|
||||||
|
|
||||||
foreach my $storePath (sort (keys %storePaths)) {
|
foreach my $storePath (sort (keys %storePaths)) {
|
||||||
|
my $base = basename $storePath;
|
||||||
print "localPath {\n";
|
print "localPath {\n";
|
||||||
print " StorePath: $storePath\n";
|
print " StorePath: $storePath\n";
|
||||||
print " CopyFrom: /tmp/inst-store$storePath\n";
|
print " CopyFrom: /tmp/inst-store/$base\n";
|
||||||
print " References: ";
|
print " References: ";
|
||||||
foreach my $ref (@{$refs{$storePath}}) {
|
foreach my $ref (@{$refs{$storePath}}) {
|
||||||
print "$ref ";
|
print "$ref ";
|
||||||
|
@ -113,20 +113,24 @@ mkdir -m 0755 -p $mountPoint/etc
|
|||||||
cp /etc/resolv.conf $mountPoint/etc/
|
cp /etc/resolv.conf $mountPoint/etc/
|
||||||
|
|
||||||
|
|
||||||
|
# Pull the manifest on the CD so that everything in the Nix store on
|
||||||
|
# the CD can be copied directly.
|
||||||
|
echo "registering substitutes to speed up builds..."
|
||||||
|
chroot $mountPoint @nix@/bin/nix-store --clear-substitutes
|
||||||
|
chroot $mountPoint @nix@/bin/nix-pull /mnt/MANIFEST
|
||||||
|
rm -f $mountPoint/tmp/inst-store
|
||||||
|
ln -s /mnt/nix/store $mountPoint/tmp/inst-store
|
||||||
|
|
||||||
|
|
||||||
# Do a nix-pull to speed up building.
|
# Do a nix-pull to speed up building.
|
||||||
if test -n "@nixpkgsURL@"; then
|
if test -n "@nixpkgsURL@"; then
|
||||||
chroot $mountPoint @nix@/bin/nix-pull @nixpkgsURL@/MANIFEST
|
chroot $mountPoint @nix@/bin/nix-pull @nixpkgsURL@/MANIFEST || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Build the specified Nix expression in the target store and install
|
# Build the specified Nix expression in the target store and install
|
||||||
# it into the system configuration profile.
|
# it into the system configuration profile.
|
||||||
|
echo "building the system configuration..."
|
||||||
#rm -rf $mountPoint/scratch
|
|
||||||
#mkdir $mountPoint/scratch
|
|
||||||
#curl $nixpkgsURL/nixexprs.tar.bz2 | tar xj -C $mountPoint/scratch
|
|
||||||
#nixpkgsName=$(cd $mountPoint/scratch && ls)
|
|
||||||
|
|
||||||
chroot $mountPoint @nix@/bin/nix-env \
|
chroot $mountPoint @nix@/bin/nix-env \
|
||||||
-p /nix/var/nix/profiles/system \
|
-p /nix/var/nix/profiles/system \
|
||||||
-f "/mnt$nixosDir/system/system.nix" \
|
-f "/mnt$nixosDir/system/system.nix" \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user