git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #22455 from taku0/hyper-v_installation

nixos-generate-config.pl, all-hardware.nix: Add support for Hyper-V

commit323031f9ed9ed0aded2138182fafb0feee7f05a5 authorEelco Dolstra <eelco.dolstra@logicblox.com> dateSun 5 Feb 2017, 11:05 (10 years ago) parent6812c708dfa60c
2 files changed+10−3
nixos/modules/installer/tools/nixos-generate-config.pl+7−3 nixos/modules/profiles/all-hardware.nix+3
nixos/modules/installer/tools/nixos-generate-config.pl+7−3
@@ -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.
nixos/modules/profiles/all-hardware.nix+3
@@ -42,6 +42,9 @@
4242 # Virtio (QEMU, KVM etc.) support.
4343 "virtio_net" "virtio_pci" "virtio_blk" "virtio_scsi" "virtio_balloon" "virtio_console"
4444
45+ # Hyper-V support.
46+ "hv_storvsc"
47+
4548 # Keyboards
4649 "usbhid" "hid_apple" "hid_logitech_dj" "hid_lenovo_tpkbd" "hid_roccat"
4750 ];