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

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