From 81a64e3c220cfec6d4558d5f3837b505dcb3a13d Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Sat, 13 Jul 2024 17:59:48 -0400 Subject: [PATCH] global/kmscon: init, refactored from software/console --- modules/global/kmscon.nix | 17 +++++++++++++ modules/modules/software/console.nix | 38 ---------------------------- 2 files changed, 17 insertions(+), 38 deletions(-) create mode 100644 modules/global/kmscon.nix delete mode 100644 modules/modules/software/console.nix diff --git a/modules/global/kmscon.nix b/modules/global/kmscon.nix new file mode 100644 index 0000000..8a9bc3e --- /dev/null +++ b/modules/global/kmscon.nix @@ -0,0 +1,17 @@ +{ pkgs, ... }: +{ + services.kmscon = { + enable = true; + hwRender = true; + useXkbConfig = true; + fonts = [ + (rec { + name = "DejaVuSansMono"; + package = (pkgs.nerdfonts.override { fonts = [ name ]; }); + }) + ]; + extraConfig = '' + font-size=14 + ''; + }; +} diff --git a/modules/modules/software/console.nix b/modules/modules/software/console.nix deleted file mode 100644 index 1e43a62..0000000 --- a/modules/modules/software/console.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ config, options, lib, ... }: -with lib; -with lib.our; -let - cfg = config.modules.software.console; - opt = options.modules.software.console; -in -{ - options.modules.software.console = with types; { - kmscon = { - enable = mkBoolOpt true; - font = { - size = mkOpt int 14; - font = mkOpt str (head config.modules.locale.fonts.defaults.monospace); - }; - extraOptions = mkOpt (separatedString " ") ""; - extraConfig = mkOpt lines ""; - }; - }; - - config = { - console = { - font = "Lat2-Terminus16"; - earlySetup = true; - }; - - services.kmscon = mkIf cfg.kmscon.enable { - enable = true; - hwRender = true; - extraConfig = '' - font-size=${toString cfg.kmscon.font.size} - font-name=${cfg.kmscon.font.font} - ${cfg.kmscon.extraConfig} - ''; - extraOptions = mkAliasDefinitions opt.kmscon.extraOptions; - }; - }; -}