From 435340ed58ac802e53e0651b060123f73c769863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 15 May 2020 07:03:21 +0100 Subject: [PATCH 1/3] nixos-generate-config: enable hidpi module for displays --- nixos/modules/installer/tools/nixos-generate-config.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl index 422c405054d..88b6b05823c 100644 --- a/nixos/modules/installer/tools/nixos-generate-config.pl +++ b/nixos/modules/installer/tools/nixos-generate-config.pl @@ -497,8 +497,8 @@ if (-f $fb_modes_file && -r $fb_modes_file) { $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";'; + push @attrs, "# high-resolution display"; + push @attrs, 'hardware.video.hidpi.enable = lib.mkDefault true;'; } } From 2fb5a9999f2236ce76c8a78baf6ca8a4ce1289c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 13 May 2020 09:42:06 +0100 Subject: [PATCH 2/3] nixos/hidpi: init --- nixos/modules/hardware/video/hidpi.nix | 16 ++++++++++++++++ nixos/modules/module-list.nix | 1 + 2 files changed, 17 insertions(+) create mode 100644 nixos/modules/hardware/video/hidpi.nix diff --git a/nixos/modules/hardware/video/hidpi.nix b/nixos/modules/hardware/video/hidpi.nix new file mode 100644 index 00000000000..ac72b652504 --- /dev/null +++ b/nixos/modules/hardware/video/hidpi.nix @@ -0,0 +1,16 @@ +{ 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 + }; +} diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index d5285cfabd7..e7a09c9baa3 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -72,6 +72,7 @@ ./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 From b6a1dc51d0bd386beefd3541e25bb24e44894bd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 25 May 2020 09:23:48 +0100 Subject: [PATCH 3/3] nixos/installer: suggest to load v32n instead if i32n v32n has more characters. --- nixos/doc/manual/installation/installing.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/doc/manual/installation/installing.xml b/nixos/doc/manual/installation/installing.xml index 673df8f2e4c..5d16ac766d6 100644 --- a/nixos/doc/manual/installation/installing.xml +++ b/nixos/doc/manual/installation/installing.xml @@ -42,7 +42,7 @@ - If the text is too small to be legible, try setfont ter-132n + If the text is too small to be legible, try setfont ter-v32n to increase the font size.