nixos-configs/modules/kmscon/default.nix

44 lines
931 B
Nix
Raw Normal View History

{
config,
lib,
...
}: let
2025-01-06 14:41:55 -05:00
inherit (lib) concatStringsSep elemAt mkIf mkOption types;
cfg = config.services.kmscon;
in {
options.services.kmscon = {
fontName = mkOption {
type = types.str;
default = elemAt config.fonts.fontconfig.defaultFonts.monospace 0;
};
fontSize = mkOption {
type = types.numbers.nonnegative;
default = 12.5;
};
fontDpi = mkOption {
type = types.numbers.nonnegative;
default = 170;
};
};
config = mkIf cfg.enable {
services.kmscon = {
useXkbConfig = true;
hwRender = false;
2025-01-06 14:41:55 -05:00
# FIXME: https://github.com/Aetf/kmscon/issues/18 Icons not rendering properly
extraOptions = concatStringsSep " " [
"--font-size ${toString cfg.fontSize}"
"--font-dpi ${toString cfg.fontDpi}"
"--font-name '${cfg.fontName}'"
];
};
};
# For accurate stack trace
_file = ./default.nix;
}