Set font face for kmscon (#195)

This commit is contained in:
King Art 2023-12-10 21:04:18 +00:00 committed by GitHub
parent 17a452c5d5
commit b5ad31b710
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,15 +3,16 @@
options.stylix.targets.kmscon.enable = options.stylix.targets.kmscon.enable =
config.lib.stylix.mkEnableTarget "the kmscon virtual console" true; config.lib.stylix.mkEnableTarget "the kmscon virtual console" true;
config.services.kmscon.extraConfig = config.services.kmscon = lib.mkIf config.stylix.targets.kmscon.enable {
fonts = [config.stylix.fonts.monospace];
extraConfig =
let let
formatBase = name: formatBase = name:
let let
getComponent = comp: config.lib.stylix.colors."${name}-rgb-${comp}"; getComponent = comp: config.lib.stylix.colors."${name}-rgb-${comp}";
in in
"${getComponent "r"},${getComponent "g"},${getComponent "b"}"; "${getComponent "r"},${getComponent "g"},${getComponent "b"}";
in in ''
lib.mkIf config.stylix.targets.kmscon.enable ''
font-size=${builtins.toString config.stylix.fonts.sizes.terminal} font-size=${builtins.toString config.stylix.fonts.sizes.terminal}
palette=custom palette=custom
@ -36,4 +37,5 @@
palette-background=${formatBase "base00"} palette-background=${formatBase "base00"}
palette-foreground=${formatBase "base05"} palette-foreground=${formatBase "base05"}
''; '';
};
} }