@@ -208,9 +208,6 @@ foreach my $path (glob "/sys/bus/pci/devices/*") {
208208 pciCheck $path;
209209}
210210
211−push @attrs, "services.xserver.videoDrivers = [ \"$videoDriver\" ];" if $videoDriver;
212−
213−
214211# Idem for USB devices.
215212
216213sub usbCheck {
@@ -277,6 +274,12 @@ if ($virt eq "qemu" || $virt eq "kvm" || $virt eq "bochs") {
277274 push @imports, "<nixpkgs/nixos/modules/profiles/qemu-guest.nix>";
278275}
279276
277+# Also for Hyper-V.
278+if ($virt eq "microsoft") {
279+ push @initrdAvailableKernelModules, "hv_storvsc";
280+ $videoDriver = "fbdev";
281+}
282+
280283
281284# Pull in NixOS configuration for containers.
282285if ($virt eq "systemd-nspawn") {
@@ -307,6 +310,7 @@ sub findStableDevPath {
307310 return $dev;
308311}
309312
313+push @attrs, "services.xserver.videoDrivers = [ \"$videoDriver\" ];" if $videoDriver;
310314
311315# Generate the swapDevices option from the currently activated swap
312316# devices.