[Desktop/Console] Prepare enhanced console support

This commit is contained in:
Antoine Viallon 2023-03-31 21:27:32 +02:00
parent d28784953c
commit 3416802ae7
Signed by: aviallon
GPG key ID: 186FC35EDEB25716

23
desktop/console.nix Normal file
View file

@ -0,0 +1,23 @@
{ config, pkgs, lib, ... }:
with lib;
let
xcfg = config.services.xserver;
generalCfg = config.aviallon.general;
in {
config = {
services.kmscon = {
hwRender = mkDefault xcfg.enable;
extraConfig = ""
+ optionalString ( ! isNull xcfg.layout )
"xkb-layout=${xcfg.layout}"
+ optionalString ( ! isNull xcfg.xkbVariant )
"xkb-variant=${xcfg.xkbVariant}"
+ optionalString ( ! isNull xcfg.xkbOptions )
"xkb-options=${xcfg.xkbOptions}"
+ "font-dpi=${toString (xcfg.dpi or 96)}"
;
enable = mkDefault (! generalCfg.minimal );
};
};
}