diff --git a/nixos/modules/system/boot/loader/limine/limine-install.py b/nixos/modules/system/boot/loader/limine/limine-install.py index a64f34eaefc3..4b17e06e9051 100644 --- a/nixos/modules/system/boot/loader/limine/limine-install.py +++ b/nixos/modules/system/boot/loader/limine/limine-install.py @@ -291,6 +291,12 @@ def config_entry(levels: int, bootspec: BootSpec, label: str, time: str) -> str: entry += f'comment: {bootspec.label}, built on {time}\n' entry += 'kernel_path: ' + get_kernel_uri(bootspec.kernel) + '\n' entry += 'cmdline: ' + ' '.join(['init=' + bootspec.init] + bootspec.kernelParams).strip() + '\n' + + # Set framebuffer resolution for Linux boot entries if configured + resolution = config('resolution') + if resolution is not None: + entry += f'resolution: {resolution}\n' + if bootspec.initrd: entry += f'module_path: ' + get_kernel_uri(bootspec.initrd) + '\n' diff --git a/nixos/modules/system/boot/loader/limine/limine.nix b/nixos/modules/system/boot/loader/limine/limine.nix index 35e81d2afcfb..ec504a43685d 100644 --- a/nixos/modules/system/boot/loader/limine/limine.nix +++ b/nixos/modules/system/boot/loader/limine/limine.nix @@ -25,6 +25,7 @@ let force = cfg.force; enrollConfig = cfg.enrollConfig; style = cfg.style; + resolution = cfg.resolution; maxGenerations = if cfg.maxGenerations == null then 0 else cfg.maxGenerations; hostArchitecture = pkgs.stdenv.hostPlatform.parsed.cpu; timeout = if config.boot.loader.timeout != null then config.boot.loader.timeout else 10; @@ -98,6 +99,27 @@ in ''; }; + resolution = lib.mkOption { + default = null; + type = lib.types.nullOr lib.types.str; + example = "1920x1080x32"; + description = '' + The framebuffer resolution to set when booting Linux entries. + This controls the GOP mode that Limine sets before handing off to the kernel, + which affects early boot graphics (e.g., simpledrm, efifb). + + Format: `x` or `xx`. + If bpp is omitted, defaults to 32. + + Note: Refresh rate is not supported because the UEFI GOP protocol only + defines framebuffer dimensions and pixel format, not display timing. + Refresh rate is determined later by the GPU driver based on EDID. + + This is distinct from {option}`boot.loader.limine.style.interface.resolution` + which only affects the Limine bootloader's own menu interface. + ''; + }; + additionalFiles = lib.mkOption { default = { }; type = lib.types.attrsOf lib.types.path;