From 8d839c167229210efb80697fdbb59a440afb980a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 24 Sep 2024 19:14:35 +0200 Subject: [PATCH] only incrase font size for older kernel --- common/hidpi.nix | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/common/hidpi.nix b/common/hidpi.nix index 85b167c..ecf70a4 100644 --- a/common/hidpi.nix +++ b/common/hidpi.nix @@ -1,6 +1,18 @@ -{ lib, pkgs, ... }: +{ + lib, + pkgs, + config, + ... +}: +let + # Starting with kernel 6.8, the console font is set in the kernel automatically to a 16x32 font: + # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dfd19a5004eff03755967086aa04254c3d91b8ec + oldKernel = lib.versionOlder config.boot.kernelPackages.kernel.version "6.8"; +in { # Just set the console font, don't mess with the font settings - console.font = lib.mkDefault "${pkgs.terminus_font}/share/consolefonts/ter-v32n.psf.gz"; - console.earlySetup = lib.mkDefault true; + console.font = lib.mkIf oldKernel ( + lib.mkDefault "${pkgs.terminus_font}/share/consolefonts/ter-v32n.psf.gz" + ); + console.earlySetup = lib.mkIf oldKernel (lib.mkDefault true); }