2023-10-26 02:37:42 +00:00
|
|
|
{ config, lib, ... }:
|
2024-07-18 14:16:04 +00:00
|
|
|
let
|
|
|
|
cfg = config.programs.kitty;
|
|
|
|
in
|
|
|
|
{
|
2023-10-26 02:37:42 +00:00
|
|
|
options.programs.kitty = {
|
2023-11-03 04:12:17 +00:00
|
|
|
useSymbolsFromNerdFont = lib.mkOption {
|
|
|
|
type = lib.types.str;
|
2023-10-26 02:37:42 +00:00
|
|
|
default = "";
|
|
|
|
example = "JetBrainsMono Nerd Font";
|
|
|
|
description = ''
|
|
|
|
NerdFont patched fonts frequently suffer from rendering issues in terminals. To mitigate
|
|
|
|
this, we can use a non-NerdFont with Kitty and use the <literal>symbol_map</literal> setting
|
|
|
|
to tell Kitty to only use a NerdFont for NerdFont symbols.
|
|
|
|
Set this option the name of an installed NerdFont (the same name you'd use in the
|
|
|
|
<literal>font_family</literal> setting), to enable this feature.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-11-03 04:12:17 +00:00
|
|
|
config = lib.mkIf (cfg.enable && cfg.useSymbolsFromNerdFont != "") {
|
|
|
|
programs.kitty.settings = {
|
2023-10-26 02:37:42 +00:00
|
|
|
# https://github.com/ryanoasis/nerd-fonts/wiki/Glyph-Sets-and-Code-Points
|
2024-07-18 14:16:04 +00:00
|
|
|
symbol_map = "U+E5FA-U+E62B,U+E700-U+E7C5,U+F000-U+F2E0,U+E200-U+E2A9,U+F500-U+FD46,U+E300-U+E3EB,U+F400-U+F4A8,U+2665,U+26a1,U+F27C,U+E0A3,U+E0B4-U+E0C8,U+E0CA,U+E0CC-U+E0D2,U+E0D4,U+23FB-U+23FE,U+2B58,U+F300-U+F313,U+E000-U+E00D ${cfg.useSymbolsFromNerdFont}";
|
2023-10-26 02:37:42 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|