nixos-configs/nixosModules/kmscon/default.nix
matt1432 24aa4b9842
All checks were successful
Discord / discord commits (push) Has been skipped
refactor: make modules independant and exposed in the flake for outside use
2024-08-02 22:32:29 -04:00

43 lines
929 B
Nix

{
config,
lib,
...
}: let
inherit (lib) 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;
# FIXME: https://github.com/Aetf/kmscon/issues/18 // Icons not rendering properly
extraOptions = builtins.concatStringsSep " " [
"--font-size ${toString cfg.fontSize}"
"--font-dpi ${toString cfg.fontDpi}"
"--font-name '${cfg.fontName}'"
];
};
};
# For accurate stack trace
_file = ./default.nix;
}