dotfiles.nix/home/kitty.nix

88 lines
2.7 KiB
Nix

{ config, lib, pkgs, ... }:
# Let-In --------------------------------------------------------------------------------------- {{{
let
inherit (lib) mkIf;
in
# }}}
{
# Kitty terminal
# https://sw.kovidgoyal.net/kitty/conf.html
# https://rycee.gitlab.io/home-manager/options.html#opt-programs.kitty.enable
programs.kitty.enable = true;
# General config ----------------------------------------------------------------------------- {{{
programs.kitty.settings = {
# # https://fsd.it/shop/fonts/pragmatapro/
# font_family = "PragmataPro Mono Liga";
font_family = "FiraCode Nerd Font";
font_size = "14.0";
adjust_line_height = "120%";
disable_ligatures = "cursor"; # disable ligatures when cursor is on them
# Window layout
hide_window_decorations = "titlebar-only";
window_padding_width = "10";
# Tab bar
tab_bar_edge = "top";
tab_bar_style = "powerline";
tab_powerline_style = "slanted";
tab_title_template = "Tab {index}: {title}";
active_tab_font_style = "bold";
inactive_tab_font_style = "normal";
tab_activity_symbol = "💬";
# Shell integration manually enabled for fish
shell_integration = "disabled";
};
# Change the style of italic font variants
# programs.kitty.extraConfig = ''
# font_features PragmataProMonoLiga-Italic +ss06
# font_features PragmataProMonoLiga-BoldItalic +ss07
# '';
programs.kitty.extras.useSymbolsFromNerdFont = "FiraCode Nerd Font";
# }}}
# Colors config ------------------------------------------------------------------------------ {{{
programs.kitty.extras.colors =
let
theme = pkgs.lib.colors.tokyonight;
in
{
enable = true;
common = theme.common;
dark = theme.dark;
light = theme.light;
};
programs.fish.functions.set-term-colors = {
body = "term-background $term_background";
onVariable = "term_background";
};
programs.fish.interactiveShellInit = ''
# Set term colors based on value of `$term_background` when shell starts up.
set-term-colors
# Manually enable shell integration
if set -q KITTY_INSTALLATION_DIR
set --global KITTY_SHELL_INTEGRATION enabled
source "$KITTY_INSTALLATION_DIR/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish"
set --prepend fish_complete_path "$KITTY_INSTALLATION_DIR/shell-integration/fish/vendor_completions.d"
end
'';
programs.fish.shellAliases = {
s = "kitty +kitten ssh";
e = "edit-in-kitty";
};
# }}}
# Fix icon config
programs.kitty.extras.fixIcon = {
enable = true;
appPath = "~/Applications/Home\\ Manager\\ Apps/kitty.app";
iconPath = "~/Development/kitty-icon/kitty-dark.icns";
};
}