mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 20:55:31 +03:00
Merge pull request #42877 from Infinisil/systemd-boot/consoleMode
nixos/systemd-boot: Add consoleMode option
This commit is contained in:
commit
31dda068db
2 changed files with 35 additions and 0 deletions
|
@ -43,6 +43,7 @@ def write_loader_conf(profile, generation):
|
||||||
f.write("default nixos-generation-%d\n" % (generation))
|
f.write("default nixos-generation-%d\n" % (generation))
|
||||||
if not @editor@:
|
if not @editor@:
|
||||||
f.write("editor 0");
|
f.write("editor 0");
|
||||||
|
f.write("console-mode @consoleMode@\n");
|
||||||
os.rename("@efiSysMountPoint@/loader/loader.conf.tmp", "@efiSysMountPoint@/loader/loader.conf")
|
os.rename("@efiSysMountPoint@/loader/loader.conf.tmp", "@efiSysMountPoint@/loader/loader.conf")
|
||||||
|
|
||||||
def profile_path(profile, generation, name):
|
def profile_path(profile, generation, name):
|
||||||
|
|
|
@ -22,6 +22,8 @@ let
|
||||||
|
|
||||||
editor = if cfg.editor then "True" else "False";
|
editor = if cfg.editor then "True" else "False";
|
||||||
|
|
||||||
|
inherit (cfg) consoleMode;
|
||||||
|
|
||||||
inherit (efi) efiSysMountPoint canTouchEfiVariables;
|
inherit (efi) efiSysMountPoint canTouchEfiVariables;
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
@ -52,6 +54,38 @@ in {
|
||||||
compatibility.
|
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:
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem><para>
|
||||||
|
<literal>"0"</literal>: Standard UEFI 80x25 mode
|
||||||
|
</para></listitem>
|
||||||
|
<listitem><para>
|
||||||
|
<literal>"1"</literal>: 80x50 mode, not supported by all devices
|
||||||
|
</para></listitem>
|
||||||
|
<listitem><para>
|
||||||
|
<literal>"2"</literal>: The first non-standard mode provided by the device firmware, if any
|
||||||
|
</para></listitem>
|
||||||
|
<listitem><para>
|
||||||
|
<literal>"auto"</literal>: Pick a suitable mode automatically using heuristics
|
||||||
|
</para></listitem>
|
||||||
|
<listitem><para>
|
||||||
|
<literal>"max"</literal>: Pick the highest-numbered available mode
|
||||||
|
</para></listitem>
|
||||||
|
<listitem><para>
|
||||||
|
<literal>"keep"</literal>: Keep the mode selected by firmware (the default)
|
||||||
|
</para></listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue