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 =
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
formatBase = name:
let
getComponent = comp: config.lib.stylix.colors."${name}-rgb-${comp}";
in
"${getComponent "r"},${getComponent "g"},${getComponent "b"}";
in
lib.mkIf config.stylix.targets.kmscon.enable ''
in ''
font-size=${builtins.toString config.stylix.fonts.sizes.terminal}
palette=custom
@ -36,4 +37,5 @@
palette-background=${formatBase "base00"}
palette-foreground=${formatBase "base05"}
'';
};
}