1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-25 07:00:43 +00:00

Use default qemu for azure image generation, and use option to enforce sizing of image to be compliant with Azure/HyperV.

This commit is contained in:
Rob Vermaas 2017-02-13 08:54:10 +00:00
parent d375f42115
commit e16db5666a
No known key found for this signature in database
GPG key ID: E114A5F264A8AE8E

View file

@ -16,14 +16,14 @@ in
cyl=$(((${diskSize}*1024*1024)/(512*63*255)))
size=$(($cyl*255*63*512))
roundedsize=$((($size/(1024*1024)+1)*(1024*1024)))
${pkgs.vmTools.qemu-220}/bin/qemu-img create -f raw $diskImage $roundedsize
${pkgs.vmTools.qemu}/bin/qemu-img create -f raw $diskImage $roundedsize
mv closure xchg/
'';
postVM =
''
mkdir -p $out
${pkgs.vmTools.qemu-220}/bin/qemu-img convert -f raw -O vpc $diskImage $out/disk.vhd
${pkgs.qemu}/bin/qemu-img convert -f raw -o force_size -O vpc $diskImage $out/disk.vhd
rm $diskImage
'';
diskImageBase = "nixos-image-${config.system.nixosLabel}-${pkgs.stdenv.system}.raw";