@@ -11,7 +11,6 @@ let
1111 modules = [
1212 ../maintainers/scripts/ec2/amazon-image.nix
1313 ../modules/testing/test-instrumentation.nix
14− ../modules/profiles/minimal.nix
1514 ../modules/profiles/qemu-guest.nix
1615 { ec2.hvm = true;
1716
@@ -30,9 +29,8 @@ let
3029 metaData = pkgs.stdenv.mkDerivation {
3130 name = "metadata";
3231 buildCommand = ''
33− mkdir -p $out/2011-01-01
34− ln -s ${pkgs.writeText "userData" userData} $out/2011-01-01/user-data
3532 mkdir -p $out/1.0/meta-data
33+ ln -s ${pkgs.writeText "userData" userData} $out/1.0/user-data
3634 echo "${hostname}" > $out/1.0/meta-data/hostname
3735 echo "(unknown)" > $out/1.0/meta-data/ami-manifest-path
3836 '' + optionalString (sshPublicKey != null) ''
@@ -48,7 +46,7 @@ let
4846 my $imageDir = ($ENV{'TMPDIR'} // "/tmp") . "/vm-state-machine";
4947 mkdir $imageDir, 0700;
5048 my $diskImage = "$imageDir/machine.qcow2";
51− system("qemu-img create -f qcow2 -o backing_file=${image}/nixos.img $diskImage") == 0 or die;
49+ system("qemu-img create -f qcow2 -o backing_file=${image}/nixos.qcow2 $diskImage") == 0 or die;
5250 system("qemu-img resize $diskImage 10G") == 0 or die;
5351
5452 # Note: we use net=169.0.0.0/8 rather than
@@ -91,7 +89,7 @@ in {
9189 '';
9290 script = ''
9391 $machine->start;
94− $machine->waitForFile("/root/user-data");
92+ $machine->waitForFile("/etc/ec2-metadata/user-data");
9593 $machine->waitForUnit("sshd.service");
9694
9795 $machine->succeed("grep unknown /etc/ec2-metadata/ami-manifest-path");
@@ -121,7 +119,7 @@ in {
121119 # Just to make sure resizing is idempotent.
122120 $machine->shutdown;
123121 $machine->start;
124− $machine->waitForFile("/root/user-data");
122+ $machine->waitForFile("/etc/ec2-metadata/user-data");
125123 '';
126124 };
127125
@@ -135,6 +133,7 @@ in {
135133 imports = [
136134 <nixpkgs/nixos/modules/virtualisation/amazon-image.nix>
137135 <nixpkgs/nixos/modules/testing/test-instrumentation.nix>
136+ <nixpkgs/nixos/modules/profiles/qemu-guest.nix>
138137 ];
139138 environment.etc.testFile = {
140139 text = "whoa";