* Fix Amazon image generation (there is no $ORIG_TMPDIR in
runInLinuxVM anymore; use /tmp/xchg instead). svn path=/nixos/trunk/; revision=29970
This commit is contained in:
parent
9076456b15
commit
5a03989036
@ -13,6 +13,7 @@ with pkgs.lib;
|
|||||||
mkdir $out
|
mkdir $out
|
||||||
diskImage=$out/nixos.img
|
diskImage=$out/nixos.img
|
||||||
${pkgs.vmTools.kvm}/bin/qemu-img create -f raw $diskImage "4G"
|
${pkgs.vmTools.kvm}/bin/qemu-img create -f raw $diskImage "4G"
|
||||||
|
mv closure xchg/
|
||||||
'';
|
'';
|
||||||
buildInputs = [ pkgs.utillinux pkgs.perl ];
|
buildInputs = [ pkgs.utillinux pkgs.perl ];
|
||||||
exportReferencesGraph =
|
exportReferencesGraph =
|
||||||
@ -31,13 +32,14 @@ with pkgs.lib;
|
|||||||
mount -o bind /proc /mnt/proc
|
mount -o bind /proc /mnt/proc
|
||||||
|
|
||||||
# Copy all paths in the closure to the filesystem.
|
# Copy all paths in the closure to the filesystem.
|
||||||
storePaths=$(perl ${pkgs.pathsFromGraph} $ORIG_TMPDIR/closure)
|
storePaths=$(perl ${pkgs.pathsFromGraph} /tmp/xchg/closure)
|
||||||
|
|
||||||
mkdir -p /mnt/nix/store
|
mkdir -p /mnt/nix/store
|
||||||
cp -prvd $storePaths /mnt/nix/store/
|
echo "copying everything (will take a while)..."
|
||||||
|
cp -prd $storePaths /mnt/nix/store/
|
||||||
|
|
||||||
# Register the paths in the Nix database.
|
# Register the paths in the Nix database.
|
||||||
printRegistration=1 perl ${pkgs.pathsFromGraph} $ORIG_TMPDIR/closure | \
|
printRegistration=1 perl ${pkgs.pathsFromGraph} /tmp/xchg/closure | \
|
||||||
chroot /mnt ${config.environment.nix}/bin/nix-store --load-db
|
chroot /mnt ${config.environment.nix}/bin/nix-store --load-db
|
||||||
|
|
||||||
# Create the system profile to allow nixos-rebuild to work.
|
# Create the system profile to allow nixos-rebuild to work.
|
||||||
|
@ -13,6 +13,7 @@ with pkgs.lib;
|
|||||||
mkdir $out
|
mkdir $out
|
||||||
diskImage=$out/image
|
diskImage=$out/image
|
||||||
${pkgs.vmTools.kvm}/bin/qemu-img create -f raw $diskImage "4G"
|
${pkgs.vmTools.kvm}/bin/qemu-img create -f raw $diskImage "4G"
|
||||||
|
mv closure xchg/
|
||||||
'';
|
'';
|
||||||
buildInputs = [ pkgs.utillinux pkgs.perl ];
|
buildInputs = [ pkgs.utillinux pkgs.perl ];
|
||||||
exportReferencesGraph =
|
exportReferencesGraph =
|
||||||
@ -38,13 +39,13 @@ with pkgs.lib;
|
|||||||
mount --bind /sys /mnt/sys
|
mount --bind /sys /mnt/sys
|
||||||
|
|
||||||
# Copy all paths in the closure to the filesystem.
|
# Copy all paths in the closure to the filesystem.
|
||||||
storePaths=$(perl ${pkgs.pathsFromGraph} $ORIG_TMPDIR/closure)
|
storePaths=$(perl ${pkgs.pathsFromGraph} /tmp/xchg/closure)
|
||||||
|
|
||||||
mkdir -p /mnt/nix/store
|
mkdir -p /mnt/nix/store
|
||||||
${pkgs.rsync}/bin/rsync -av $storePaths /mnt/nix/store/
|
${pkgs.rsync}/bin/rsync -av $storePaths /mnt/nix/store/
|
||||||
|
|
||||||
# Register the paths in the Nix database.
|
# Register the paths in the Nix database.
|
||||||
printRegistration=1 perl ${pkgs.pathsFromGraph} $ORIG_TMPDIR/closure | \
|
printRegistration=1 perl ${pkgs.pathsFromGraph} /tmp/xchg/closure | \
|
||||||
chroot /mnt ${config.environment.nix}/bin/nix-store --load-db
|
chroot /mnt ${config.environment.nix}/bin/nix-store --load-db
|
||||||
|
|
||||||
# Create the system profile to allow nixos-rebuild to work.
|
# Create the system profile to allow nixos-rebuild to work.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user