Merge pull request #88669 from Mic92/hidpi

nixos/hidpi: Reasonable defaults for high-density displays

Changed files
+20 -3
nixos
doc
manual
installation
modules
hardware
video
installer
+1 -1
nixos/doc/manual/installation/installing.xml
···
</para>
<para>
-
If the text is too small to be legible, try <command>setfont ter-132n</command>
to increase the font size.
</para>
···
</para>
<para>
+
If the text is too small to be legible, try <command>setfont ter-v32n</command>
to increase the font size.
</para>
+16
nixos/modules/hardware/video/hidpi.nix
···
···
+
{ lib, pkgs, config, ...}:
+
with lib;
+
+
{
+
options.hardware.video.hidpi.enable = mkEnableOption "Font/DPI configuration optimized for HiDPI displays";
+
+
config = mkIf config.hardware.video.hidpi.enable {
+
console.font = lib.mkDefault "${pkgs.terminus_font}/share/consolefonts/ter-v32n.psf.gz";
+
+
# Needed when typing in passwords for full disk encryption
+
console.earlySetup = mkDefault true;
+
boot.loader.systemd-boot.consoleMode = mkDefault "1";
+
+
# TODO Find reasonable defaults X11 & wayland
+
};
+
}
+2 -2
nixos/modules/installer/tools/nixos-generate-config.pl
···
$modes =~ m/([0-9]+)x([0-9]+)/;
my $console_width = $1, my $console_height = $2;
if ($console_width > 1920) {
-
push @attrs, "# High-DPI console";
-
push @attrs, 'console.font = lib.mkDefault "${pkgs.terminus_font}/share/consolefonts/ter-u28n.psf.gz";';
}
}
···
$modes =~ m/([0-9]+)x([0-9]+)/;
my $console_width = $1, my $console_height = $2;
if ($console_width > 1920) {
+
push @attrs, "# high-resolution display";
+
push @attrs, 'hardware.video.hidpi.enable = lib.mkDefault true;';
}
}
+1
nixos/modules/module-list.nix
···
./hardware/video/capture/mwprocapture.nix
./hardware/video/bumblebee.nix
./hardware/video/displaylink.nix
./hardware/video/nvidia.nix
./hardware/video/uvcvideo/default.nix
./hardware/video/webcam/facetimehd.nix
···
./hardware/video/capture/mwprocapture.nix
./hardware/video/bumblebee.nix
./hardware/video/displaylink.nix
+
./hardware/video/hidpi.nix
./hardware/video/nvidia.nix
./hardware/video/uvcvideo/default.nix
./hardware/video/webcam/facetimehd.nix