From c00e9ebd9d2a931518b2346bf25b7648c49c8344 Mon Sep 17 00:00:00 2001 From: K900 Date: Fri, 10 Jan 2025 23:29:16 +0300 Subject: [PATCH 1/3] linux/common-config: disable FB_HYPERV when DRM_HYPERV is available It is still for some reason preferred over DRM_HYPERV despite being objectively worse. --- pkgs/os-specific/linux/kernel/common-config.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix index 302325018eac..4fb187270ed3 100644 --- a/pkgs/os-specific/linux/kernel/common-config.nix +++ b/pkgs/os-specific/linux/kernel/common-config.nix @@ -525,6 +525,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 From b20e6abfaf51eec59a154672344d0184e48840da Mon Sep 17 00:00:00 2001 From: K900 Date: Fri, 10 Jan 2025 23:35:50 +0300 Subject: [PATCH 2/3] nixos/hyperv-guest: remove the now useless videoMode option --- nixos/modules/virtualisation/hyperv-guest.nix | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/nixos/modules/virtualisation/hyperv-guest.nix b/nixos/modules/virtualisation/hyperv-guest.nix index af7ef02bdcff..1bdf6ab29d39 100644 --- a/nixos/modules/virtualisation/hyperv-guest.nix +++ b/nixos/modules/virtualisation/hyperv-guest.nix @@ -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. - ''; - }; }; }; @@ -34,7 +27,7 @@ in { initrd.availableKernelModules = [ "hyperv_keyboard" ]; kernelParams = [ - "video=hyperv_fb:${cfg.videoMode}" "elevator=noop" + "elevator=noop" ]; }; From 94e1e0a173482a65bb1a6ca86e95b4265c9e2bc4 Mon Sep 17 00:00:00 2001 From: K900 Date: Fri, 10 Jan 2025 23:36:55 +0300 Subject: [PATCH 3/3] doc/rl-2505: relnote the videoMode removal --- doc/release-notes/rl-2505.section.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/release-notes/rl-2505.section.md b/doc/release-notes/rl-2505.section.md index 901124b91c7c..956d9fb754e9 100644 --- a/doc/release-notes/rl-2505.section.md +++ b/doc/release-notes/rl-2505.section.md @@ -18,6 +18,8 @@ - [`lib.types.enum`](https://nixos.org/manual/nixos/unstable/#sec-option-types-basic): Previously the `functor.payload` was the list of enum values directly. Now it is an attribute set containing the values in the `values` attribute. - [`lib.types.separatedString`](https://nixos.org/manual/nixos/unstable/#sec-option-types-string): Previously the `functor.payload` was the seperator directly. Now it is an attribute set containing the seperator in the `sep` attribute. +- The `virtualisation.hypervGuest.videoMode` option has been removed. Standard tooling can now be used to configure display modes for Hyper-V VMs. + ### Deprecations {#sec-nixpkgs-release-25.05-lib-deprecations} `functor` is an implementation detail and should not be relied upon, but since its status wasn't clear and it has had some use cases without alternatives, changes are being handled as gracefully as possible. Deprecations within functor: