Plasma 6 on Xorg does not detect laptop screen

Hi. I am using a Lenovo Legion 5 laptop which has the following hardware:

CPU: Intel i5-10300H (8) @ 4.500GHz
GPU: Intel CometLake-H GT2 [UHD Graphics]
GPU: NVIDIA GeForce GTX 1650 Mobile / Max-Q

I have configured the laptop to only use the discreet GPU in the BIOS settings. And these are my configs with the comments stripped out. It’s the entirety of the config since it’s a fresh install:

configuration.nix
{ config, lib, pkgs, ... }:
{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
    ];
  nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
    "nvidia-x11"
    "nvidia-settings"
  ];
  networking.hostId = "e68c701e";
  boot.loader.grub = {
    enable = true;
    zfsSupport = true;
    efiSupport = true;
    efiInstallAsRemovable = true;
    mirroredBoots = [
      { devices = [ "nodev" ]; path = "/boot"; }
    ];
  };
  users.users.me = {
    isNormalUser = true;
    # Redacted
  };
  networking.hostName = "legion"; # Define your hostname.
  networking.networkmanager.enable = true;  # Easiest to use and most distros use this by default.
  time.timeZone = "Asia/Kolkata";
  hardware.nvidia = {
    open = false;
  };
  services.xserver = {
    enable = true;
    videoDrivers = [ "nvidia" ];
  };
  services.displayManager.sddm.enable = true;
  services.desktopManager.plasma6.enable = true;
  environment.plasma6.excludePackages = with pkgs.kdePackages; [
    khelpcenter
  ];
  services.pipewire = {
    enable = true;
    pulse.enable = true;
  };
  services.libinput.enable = true;
  programs.firefox.enable = true;
  environment.systemPackages = with pkgs; [
    git
    neovim
    (pkgs.pass.withExtensions (exts: [exts.pass-otp]))
    ghostty
  ];
  programs.mtr.enable = true;
  programs.gnupg.agent = {
    enable = true;
    enableSSHSupport = true;
  };
  system.stateVersion = "24.11"; # Did you read the comment?
}
hardware-configuration.nix
{ config, lib, pkgs, modulesPath, ... }:

{
  imports =
    [ (modulesPath + "/installer/scan/not-detected.nix")
    ];

  boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
  boot.initrd.kernelModules = [ ];
  boot.kernelModules = [ "kvm-intel" ];
  boot.extraModulePackages = [ ];

  fileSystems."/" =
    { device = "zroot/root";
      fsType = "zfs";
    };

  fileSystems."/home" =
    { device = "zroot/home";
      fsType = "zfs";
    };

  fileSystems."/var" =
    { device = "zroot/var";
      fsType = "zfs";
    };

  fileSystems."/nix" =
    { device = "zroot/nix";
      fsType = "zfs";
    };

  fileSystems."/boot" =
    { device = "/dev/disk/by-uuid/F4FC-81AC";
      fsType = "vfat";
      options = [ "fmask=0022" "dmask=0022" ];
    };

  swapDevices = [ {
    device = "/dev/disk/by-uuid/c7116faf-a8bc-425b-b8b9-d5f9fedb92c5";
  } ];

  networking.useDHCP = lib.mkDefault true;

  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
  hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

When I select the Xorg version of Plasma in display manager, the laptop screen is not detected as a display. It continues to show the TTY stuff. The display manager appears on the laptop display but as after I log in the laptop display becomes unusable. Really strange stuff.

On the Wayland version the laptop display works fine. But the Wayland version is almost unusable for me because it causes really bad stutters. Thank you, Nvidia, one of the most valued companies in the world as of now, for providing this peasant with terrible drivers.

The bigger problem is that I don’t know how to debug this.

If anyone has any pointer I would really appreciate it.

Thank you.

Popping in to say that this was a false alarm. Turns out that “Dynamic Graphics” was indeed selected in the BIOS settings. I don’t remember doing that so it looks like the gremlins are back at it.