Skip to content

Commit

Permalink
Set font face for kmscon (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
kingarrrt authored Dec 10, 2023
1 parent 17a452c commit b5ad31b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions modules/kmscon/nixos.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -36,4 +37,5 @@
palette-background=${formatBase "base00"}
palette-foreground=${formatBase "base05"}
'';
};
}

0 comments on commit b5ad31b

Please sign in to comment.