Change grub resolution

I have a Thinkpad p14s G2 (AMD) that has a 4k screen.

I tried to change the grub resolution like this:

  boot.loader.grub = {
    extraConfig = ''
      GRUB_CMDLINE_LINUX="amdgpu.backlight=0"
      GRUB_GFXMODE=1024x768x32
      GRUB_GFXPAYLOAD_LINUX=keep
      GRUB_TERMINAL_OUTPUT="gfxterm"
    '';
  };

But it has no effect. I am missing something?

I have this in one of my configuarations:

  boot.loader = {
    grub = {
      enable = true;
      efiSupport = true;
      device = "nodev";
      fsIdentifier = "label";
      efiInstallAsRemovable = true;
      gfxmodeEfi = "3440x1440";
      font = "${pkgs.hack-font}/share/fonts/hack/Hack-Regular.ttf";
      fontSize = 36;
    };
  };

Be sure to run sudo nixos-rebuild switch after making your changes.

After upgrading to 24.11, that config stopped working :cry:

  boot.loader.grub = {
    enable = true;
    efiSupport = true;
    device = "nodev";
    fsIdentifier = "label";
    efiInstallAsRemovable = true;
    gfxmodeEfi = "3440x1440";
    font = "${pkgs.hack-font}/share/fonts/hack/Hack-Regular.ttf";
    fontSize = 36;
  };

Grub doesn’t set the screen resolution to 3440x1440, and it doesn’t load the default nixos splash.

1 Like

The same problem. Set gfxmodeEfi option but nothing works.

I think it’s unlikely that your BIOS would support such a large screen resolution.
I have laptop with a 200dpi screen and the highest mode supported is 1280x720.

To find which modes are supported you can use vbeinfo (for BIOS) or videoinfo (for EFI) in the GRUB shell. Then set:

boot.loader.grub.gfxmodeBios = "1280x720";  # for BIOS, or
boot.loader.grub.gfxmodeEfi = "1280x720";   # for EFI
boot.loader.grub.gfxpayloadBios = "keep";

I also to set gfxmodeBios to the same value as gfxmodeEfi. Both also have a ,auto after the resolution.

And I also set:

extraConfig = ''
  insmod gfxterm
  insmod png
  set icondir=($root)/theme/icons
'';

Don’t ask me why is set those because I don’t really remember and definitely got ther by try and error.

I seem to have found the problem, which seems to be the cause of the catppuccin theme. Might need to change its pkg.