summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorLinus Heckemann <git@sphalerite.org>2020-07-22 17:43:03 +0200
committerGitHub <noreply@github.com>2020-07-22 17:43:03 +0200
commita5d20d25eb136a8ad85864c1be5325dd50aaa880 (patch)
tree3caaa5abf373a81e146bc891032a50af2d6a3587 /nixos
parent714fac4cc9ba9b0ef29964c8b7fd9d50455aa380 (diff)
parentb6a1dc51d0bd386beefd3541e25bb24e44894bd7 (diff)
downloadnixpkgs-a5d20d25eb136a8ad85864c1be5325dd50aaa880.tar
nixpkgs-a5d20d25eb136a8ad85864c1be5325dd50aaa880.tar.gz
nixpkgs-a5d20d25eb136a8ad85864c1be5325dd50aaa880.tar.bz2
nixpkgs-a5d20d25eb136a8ad85864c1be5325dd50aaa880.tar.lz
nixpkgs-a5d20d25eb136a8ad85864c1be5325dd50aaa880.tar.xz
nixpkgs-a5d20d25eb136a8ad85864c1be5325dd50aaa880.tar.zst
nixpkgs-a5d20d25eb136a8ad85864c1be5325dd50aaa880.zip
Merge pull request #88669 from Mic92/hidpi
nixos/hidpi: Reasonable defaults for high-density displays
Diffstat (limited to 'nixos')
-rw-r--r--nixos/doc/manual/installation/installing.xml2
-rw-r--r--nixos/modules/hardware/video/hidpi.nix16
-rw-r--r--nixos/modules/installer/tools/nixos-generate-config.pl4
-rw-r--r--nixos/modules/module-list.nix1
4 files changed, 20 insertions, 3 deletions
diff --git a/nixos/doc/manual/installation/installing.xml b/nixos/doc/manual/installation/installing.xml
index 48307ca2469..5f216df66f8 100644
--- a/nixos/doc/manual/installation/installing.xml
+++ b/nixos/doc/manual/installation/installing.xml
@@ -42,7 +42,7 @@
   </para>
 
   <para>
-   If the text is too small to be legible, try <command>setfont ter-132n</command>
+   If the text is too small to be legible, try <command>setfont ter-v32n</command>
    to increase the font size.
   </para>
 
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/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl
index 157dc28e0a8..c8303a6eb60 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;';
     }
 }
 
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index a3bc489d0b7..9e4e39371f4 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