diff --git a/nixos/modules/profiles/qemu-guest.nix b/nixos/modules/profiles/qemu-guest.nix index c8e6fd4aa768..0a92b7ace507 100644 --- a/nixos/modules/profiles/qemu-guest.nix +++ b/nixos/modules/profiles/qemu-guest.nix @@ -5,5 +5,13 @@ { boot.initrd.availableKernelModules = [ "virtio_net" "virtio_pci" "virtio_blk" "9p" "9pnet_virtio" ]; - boot.kernelModules = [ "virtio_balloon" "virtio_console" ]; + boot.initrd.kernelModules = [ "virtio_balloon" "virtio_console" ]; + + boot.initrd.postDeviceCommands = + '' + # Set the system time from the hardware clock to work around a + # bug in qemu-kvm > 1.5.2 (where the VM clock is initialised + # to the *boot time* of the host). + hwclock -s + ''; } diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix index 80bc71bbb8c6..a866b513f0f2 100644 --- a/nixos/modules/virtualisation/qemu-vm.nix +++ b/nixos/modules/virtualisation/qemu-vm.nix @@ -291,11 +291,6 @@ in if test -z "$FSTYPE"; then mke2fs -t ext4 /dev/vda fi - - # Set the system time from the hardware clock to work around a - # bug in qemu-kvm > 1.5.2 (where the VM clock is initialised - # to the *boot time* of the host). - hwclock -s ''; boot.initrd.postMountCommands = diff --git a/nixos/tests/installer.nix b/nixos/tests/installer.nix index b32012ea0347..7929ef872b5c 100644 --- a/nixos/tests/installer.nix +++ b/nixos/tests/installer.nix @@ -39,7 +39,8 @@ let { imports = [ ./hardware-configuration.nix - "''${modulesPath}/testing/test-instrumentation.nix" + + ]; boot.loader.grub.version = ${toString grubVersion}; @@ -48,7 +49,6 @@ let ''} boot.loader.grub.device = "${grubDevice}"; boot.loader.grub.extraConfig = "serial; terminal_output.serial"; - boot.initrd.kernelModules = [ "virtio_console" ]; environment.systemPackages = [ ${optionalString testChannel "pkgs.rlwrap"} ]; }