amazon-image: support VPC/VHD as an output format for the builder

+9 -3
+8 -2
nixos/lib/make-disk-image.nix
··· 39 39 with lib; 40 40 41 41 let 42 + extensions = { 43 + qcow2 = "qcow2"; 44 + vpc = "vhd"; 45 + raw = "img"; 46 + }; 47 + 42 48 # Copied from https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/cd-dvd/channel.nix 43 49 # TODO: factor out more cleanly 44 50 ··· 142 148 mv $diskImage $out/nixos.img 143 149 diskImage=$out/nixos.img 144 150 '' else '' 145 - ${pkgs.qemu}/bin/qemu-img convert -f raw -O qcow2 $diskImage $out/nixos.qcow2 146 - diskImage=$out/nixos.qcow2 151 + ${pkgs.qemu}/bin/qemu-img convert -f raw -O ${format} $diskImage $out/nixos.${extensions.${format}} 152 + diskImage=$out/nixos.${extensions.${format}} 147 153 ''} 148 154 ${postVM} 149 155 '';
+1 -1
nixos/maintainers/scripts/ec2/amazon-image.nix
··· 24 24 }; 25 25 26 26 format = mkOption { 27 - type = types.enum [ "raw" "qcow2" ]; 27 + type = types.enum [ "raw" "qcow2" "vpc" ]; 28 28 default = "qcow2"; 29 29 description = "The image format to output"; 30 30 };