diff options
author | taku0 <mxxouy6x3m_github@tatapa.org> | 2017-02-05 11:46:27 +0900 |
---|---|---|
committer | taku0 <mxxouy6x3m_github@tatapa.org> | 2017-02-05 18:22:26 +0900 |
commit | 8dfa60ce73f6bb9128fb577a8d0df3f8b86f3ddf (patch) | |
tree | 25bf6c6fed0a7c95fd7b7d4b0f4f4f6864ccbe2a /nixos | |
parent | f9c684e1528c6e595580f4c6cdb3d6f22ae6a2e4 (diff) | |
download | nixpkgs-8dfa60ce73f6bb9128fb577a8d0df3f8b86f3ddf.tar nixpkgs-8dfa60ce73f6bb9128fb577a8d0df3f8b86f3ddf.tar.gz nixpkgs-8dfa60ce73f6bb9128fb577a8d0df3f8b86f3ddf.tar.bz2 nixpkgs-8dfa60ce73f6bb9128fb577a8d0df3f8b86f3ddf.tar.lz nixpkgs-8dfa60ce73f6bb9128fb577a8d0df3f8b86f3ddf.tar.xz nixpkgs-8dfa60ce73f6bb9128fb577a8d0df3f8b86f3ddf.tar.zst nixpkgs-8dfa60ce73f6bb9128fb577a8d0df3f8b86f3ddf.zip |
nixos-generate-config.pl, all-hardware.nix: Add support for Hyper-V
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/installer/tools/nixos-generate-config.pl | 10 | ||||
-rw-r--r-- | nixos/modules/profiles/all-hardware.nix | 3 |
2 files changed, 10 insertions, 3 deletions
diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl index 0a5624ff6a3..c920a2b52d8 100644 --- a/nixos/modules/installer/tools/nixos-generate-config.pl +++ b/nixos/modules/installer/tools/nixos-generate-config.pl @@ -208,9 +208,6 @@ foreach my $path (glob "/sys/bus/pci/devices/*") { pciCheck $path; } -push @attrs, "services.xserver.videoDrivers = [ \"$videoDriver\" ];" if $videoDriver; - - # Idem for USB devices. sub usbCheck { @@ -277,6 +274,12 @@ if ($virt eq "qemu" || $virt eq "kvm" || $virt eq "bochs") { push @imports, "<nixpkgs/nixos/modules/profiles/qemu-guest.nix>"; } +# Also for Hyper-V. +if ($virt eq "microsoft") { + push @initrdAvailableKernelModules, "hv_storvsc"; + $videoDriver = "fbdev"; +} + # Pull in NixOS configuration for containers. if ($virt eq "systemd-nspawn") { @@ -307,6 +310,7 @@ sub findStableDevPath { return $dev; } +push @attrs, "services.xserver.videoDrivers = [ \"$videoDriver\" ];" if $videoDriver; # Generate the swapDevices option from the currently activated swap # devices. diff --git a/nixos/modules/profiles/all-hardware.nix b/nixos/modules/profiles/all-hardware.nix index 99b45228ce4..6b4d8c737eb 100644 --- a/nixos/modules/profiles/all-hardware.nix +++ b/nixos/modules/profiles/all-hardware.nix @@ -42,6 +42,9 @@ # Virtio (QEMU, KVM etc.) support. "virtio_net" "virtio_pci" "virtio_blk" "virtio_scsi" "virtio_balloon" "virtio_console" + # Hyper-V support. + "hv_storvsc" + # Keyboards "usbhid" "hid_apple" "hid_logitech_dj" "hid_lenovo_tpkbd" "hid_roccat" ]; |