diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2015-09-28 14:31:19 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2015-09-28 14:31:19 +0200 |
commit | b3347287be60aebc723702b5b298f9738ce8481c (patch) | |
tree | 3edfba297d72bc2fdf6cccc504ea364a40a58671 /nixos/lib/make-disk-image.nix | |
parent | f596f0323f82eaaa819720fb5734a306e46b5541 (diff) | |
download | nixlib-b3347287be60aebc723702b5b298f9738ce8481c.tar nixlib-b3347287be60aebc723702b5b298f9738ce8481c.tar.gz nixlib-b3347287be60aebc723702b5b298f9738ce8481c.tar.bz2 nixlib-b3347287be60aebc723702b5b298f9738ce8481c.tar.lz nixlib-b3347287be60aebc723702b5b298f9738ce8481c.tar.xz nixlib-b3347287be60aebc723702b5b298f9738ce8481c.tar.zst nixlib-b3347287be60aebc723702b5b298f9738ce8481c.zip |
Use make-disk-image.nix for VirtualBox images
Diffstat (limited to 'nixos/lib/make-disk-image.nix')
-rw-r--r-- | nixos/lib/make-disk-image.nix | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/nixos/lib/make-disk-image.nix b/nixos/lib/make-disk-image.nix index 386d88a5b351..54090c95a569 100644 --- a/nixos/lib/make-disk-image.nix +++ b/nixos/lib/make-disk-image.nix @@ -19,6 +19,9 @@ # /etc/nixos/configuration.nix. configFile ? null +, # Shell code executed after the VM has finished. + postVM ? "" + }: with lib; @@ -35,6 +38,7 @@ pkgs.vmTools.runInLinuxVM ( buildInputs = [ pkgs.utillinux pkgs.perl pkgs.e2fsprogs pkgs.parted ]; exportReferencesGraph = [ "closure" config.system.build.toplevel ]; + inherit postVM; } '' ${if partitioned then '' @@ -68,6 +72,7 @@ pkgs.vmTools.runInLinuxVM ( mkdir -p /mnt/nix/store echo "copying everything (will take a while)..." + set -f cp -prd $storePaths /mnt/nix/store/ # Register the paths in the Nix database. @@ -94,6 +99,7 @@ pkgs.vmTools.runInLinuxVM ( # Generate the GRUB menu. ln -s vda /dev/xvda + ln -s vda /dev/sda chroot /mnt ${config.system.build.toplevel}/bin/switch-to-configuration boot umount /mnt/proc /mnt/dev /mnt/sys |