dotfiles.nix/home/kitty.nix

112 lines
3.1 KiB
Nix
Raw Normal View History

2022-11-20 22:07:02 +00:00
{ pkgs, ... }:
2022-01-23 01:32:58 +00:00
# Let-In --------------------------------------------------------------------------------------- {{{
let
2022-07-26 04:22:16 +00:00
colorsToKitty = colors: with colors; {
inherit
background
foreground
selection_background
selection_foreground
tab_bar_background
active_tab_background
active_tab_foreground
inactive_tab_background
inactive_tab_foreground;
cursor = white;
cursor_text_color = background;
color0 = black;
color8 = black;
color1 = red;
color9 = red;
color2 = green;
color10 = lime;
color3 = yellow;
color11 = orange;
color4 = blue;
color12 = blue;
color5 = magenta;
color13 = magenta;
color6 = cyan;
color14 = cyan;
color7 = white;
color15 = white;
url_color = brightgreen;
};
2022-11-20 15:38:04 +00:00
font = "CaskaydiaCove Nerd Font";
2022-01-23 01:32:58 +00:00
in
# }}}
2022-01-23 01:32:58 +00:00
{
# 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 = {
2022-11-20 15:38:04 +00:00
font_family = font;
2022-01-23 01:32:58 +00:00
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";
2022-02-12 23:30:53 +00:00
tab_powerline_style = "slanted";
2022-01-23 01:32:58 +00:00
tab_title_template = "Tab {index}: {title}";
active_tab_font_style = "bold";
inactive_tab_font_style = "normal";
2022-02-12 23:30:53 +00:00
tab_activity_symbol = "💬";
2022-01-23 01:32:58 +00:00
# Shell integration manually enabled for fish
shell_integration = "disabled";
2022-07-29 22:01:24 +00:00
macos_option_as_alt = "both";
2022-01-23 01:32:58 +00:00
};
2022-11-20 15:38:04 +00:00
programs.kitty.extras.useSymbolsFromNerdFont = font;
2022-01-23 01:32:58 +00:00
# }}}
# Colors config ------------------------------------------------------------------------------ {{{
2022-07-26 04:22:16 +00:00
programs.kitty.extras.colors.enable = true;
programs.kitty.extras.colors.dark = colorsToKitty pkgs.lib.colors.tokyonight.dark;
programs.kitty.extras.colors.light = colorsToKitty pkgs.lib.colors.tokyonight.light;
2022-01-23 01:32:58 +00:00
programs.fish.functions.set-term-colors = {
2022-07-26 04:22:16 +00:00
body = ''
if test "$term_background" = light
term-light
else
term-dark
end
'';
2022-01-23 01:32:58 +00:00
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
'';
2022-07-04 22:00:05 +00:00
programs.fish.shellAliases = {
s = "kitty +kitten ssh";
e = "edit-in-kitty";
};
2022-01-23 01:32:58 +00:00
# }}}
2022-05-08 01:50:31 +00:00
# Fix icon config
programs.kitty.extras.fixIcon = {
enable = true;
2022-05-08 01:53:45 +00:00
appPath = "~/Applications/Home\\ Manager\\ Apps/kitty.app";
2022-07-30 02:15:19 +00:00
iconPath = "${pkgs.kitty-icon}/kitty-dark.icns";
2022-05-08 01:50:31 +00:00
};
}