Skip to content

Commit

Permalink
Backport #372743 to release 24.11 (#374560)
Browse files Browse the repository at this point in the history
  • Loading branch information
K900 authored Jan 17, 2025
2 parents 335b761 + 92a5805 commit d875b07
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
21 changes: 7 additions & 14 deletions nixos/modules/virtualisation/hyperv-guest.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,15 @@ let
cfg = config.virtualisation.hypervGuest;

in {
imports = [
(mkRemovedOptionModule [ "virtualisation" "hypervGuest" "videoMode" ]
"The video mode can now be configured via standard tools, or in Hyper-V VM settings."
)
];

options = {
virtualisation.hypervGuest = {
enable = mkEnableOption "Hyper-V Guest Support";

videoMode = mkOption {
type = types.str;
default = "1152x864";
example = "1024x768";
description = ''
Resolution at which to initialize the video adapter.
Supports screen resolution up to Full HD 1920x1080 with 32 bit color
on Windows Server 2012, and 1600x1200 with 16 bit color on Windows
Server 2008 R2 or earlier.
'';
};
};
};

Expand All @@ -34,7 +27,7 @@ in {
initrd.availableKernelModules = [ "hyperv_keyboard" ];

kernelParams = [
"video=hyperv_fb:${cfg.videoMode}" "elevator=noop"
"elevator=noop"
];
};

Expand Down
2 changes: 2 additions & 0 deletions pkgs/os-specific/linux/kernel/common-config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,8 @@ let
DRM_I915_GVT_KVMGT = module;
# Enable Hyper-V Synthetic DRM Driver
DRM_HYPERV = whenAtLeast "5.14" module;
# And disable the legacy framebuffer driver when we have the new one
FB_HYPERV = whenAtLeast "5.14" no;
}
// lib.optionalAttrs (stdenv.hostPlatform.system == "aarch64-linux") {
# enable HDMI-CEC on RPi boards
Expand Down

0 comments on commit d875b07

Please sign in to comment.