Change:
NixOS's default kernel configuration only enables the 8x8 and 8x16 fonts. This is not ideal, because they are too small for high-resolution displays. The current workaround used by is to set . There are problems with this however: during early boot, before the GPU drivers are loaded, the firmware or bootloader may initialize the display at a lower resolution, resulting in an oversized font in fact, the hidpi module sets , which in my opinion is a bad idea, because it will force switching to a low resolution when the firmware could have set us up with a high-res framebuffer; this also breaks seamless boot for those who care (sd-boot's default is to keep the mode unchanged) resolution switches reset the font to the kernel default, and under certain circumstances it seems a race condition can prevent userspace from setting the font correctly again The kernel is actually able to select an appropriate font for the current resolution using a simple heuristic since mid-2019 (). This bypasses the problems listed above and ensures a good font is always selected after resolution switches. The only requirement appears to be that the fonts must be built into the kernel. Font-related kconfig options as configured by NixOS: Arch Linux: So Arch enables the default 8x16 and Terminus 16x32 (the same font that the hidpi module sets). The observed behavior on Arch is that it seamlessly switches fonts after mode switches, and I've never seen this break since it has been enabled.
Same issue here with a NVIDIA card and a 3840x1600 monitor. tty0 console text covers the entire screen. I couldn't resolve this issue manually with and (DP-3 is my monitor). Setting the font manually to the default value () gives the right font size but this particular font doesn't have antialiasing which looks quite bad on a HIDPI monitor.
There's no antialiasing in console fonts, they're all bitmap fonts.
Gotcha, thanks. On side note, I looked for a different consolefont and came up with this. Looks a lot better now :smile:

Discussion:
# Sadly, systemd-vconsole-setup doesn't support binary keymaps. vconsoleConf = pkgs.writeText "vconsole.conf" '' KEYMAP=${cfg.keyMap} <del> FONT=${cfg.font} </del> <ins> ${optionalString (cfg.font != null) "FONT=${cfg.font}"} </ins> ''; consoleEnv = kbd: pkgs.buildEnv {

}; font = mkOption { <del> type = with types; either str path; </del> <ins> type = with types; nullOr (either str path); </ins> default = "Lat2-Terminus16"; example = "LatArCyrHeb-16"; description = mdDoc ''

whatever the {command}`setfont` program considers the default font. Can be either a font name or a path to a PSF font file. <ins> Use `null` to let the kernel choose a built-in font. The default is 8x16, and, as of Linux 5.3, Terminus 32 bold for display resolutions of 2560x1080 and higher. These fonts cover the [IBM437][] character set. [IBM437]: https://en.wikipedia.org/wiki/Code_page_437 </ins> ''; };

printf "033%%${if isUnicode then "G" else "@"}" >> /dev/console loadkmap < ${optimizedKeymap} <del> ${optionalString cfg.earlySetup '' </del> <ins> ${optionalString (cfg.earlySetup && cfg.font != null) '' </ins> setfont -C /dev/console $extraUtils/share/consolefonts/font.psf ''} '');

"${config.boot.initrd.systemd.package.kbd}/bin/setfont" "${config.boot.initrd.systemd.package.kbd}/bin/loadkeys" "${config.boot.initrd.systemd.package.kbd.gzip}/bin/gzip" # Fonts and keyboard layouts are compressed <del> ] ++ optionals (hasPrefix builtins.storeDir cfg.font) [ </del> <ins> ] ++ optionals (cfg.font != null && hasPrefix builtins.storeDir cfg.font) [ </ins> "${cfg.font}" ] ++ optionals (hasPrefix builtins.storeDir cfg.keyMap) [ "${cfg.keyMap}"

]; }) <del> (mkIf (cfg.earlySetup && !config.boot.initrd.systemd.enable) { </del> <ins> (mkIf (cfg.earlySetup && cfg.font != null && !config.boot.initrd.systemd.enable) { </ins> boot.initrd.extraUtilsCommands = '' mkdir -p $out/share/consolefonts ${if substring 0 1 cfg.font == "/" then ''

DRM_SIMPLEDRM = whenAtLeast "5.14" no; }; <ins> fonts = { FONTS = yes; # Default fonts enabled if FONTS is not set FONT_8x8 = yes; FONT_8x16 = yes; # High DPI font FONT_TER16x32 = whenAtLeast "5.0" yes; }; </ins> video = { DRM_LEGACY = no; NOUVEAU_LEGACY_CTX_SUPPORT = whenAtLeast "5.2" no;