diff --git a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py index 3333569c36be..1dc888c58227 100644 --- a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py +++ b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py @@ -43,6 +43,7 @@ def write_loader_conf(profile, generation): f.write("default nixos-generation-%d\n" % (generation)) if not @editor@: f.write("editor 0"); + f.write("console-mode @consoleMode@\n"); os.rename("@efiSysMountPoint@/loader/loader.conf.tmp", "@efiSysMountPoint@/loader/loader.conf") def profile_path(profile, generation, name): diff --git a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix index a5a88a99be8f..feed863efd66 100644 --- a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix +++ b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix @@ -22,6 +22,8 @@ let editor = if cfg.editor then "True" else "False"; + inherit (cfg) consoleMode; + inherit (efi) efiSysMountPoint canTouchEfiVariables; }; in { @@ -52,6 +54,38 @@ in { compatibility. ''; }; + + consoleMode = mkOption { + default = "keep"; + + type = types.enum [ "0" "1" "2" "auto" "max" "keep" ]; + + description = '' + The resolution of the console. The following values are valid: + + + + + "0": Standard UEFI 80x25 mode + + + "1": 80x50 mode, not supported by all devices + + + "2": The first non-standard mode provided by the device firmware, if any + + + "auto": Pick a suitable mode automatically using heuristics + + + "max": Pick the highest-numbered available mode + + + "keep": Keep the mode selected by firmware (the default) + + + ''; + }; }; config = mkIf cfg.enable {