dotfiles.nix/home/kitty.nix

74 lines
2.0 KiB
Nix

{ pkgs, lib, ... }:
let
font = "Rec Mono Duotone";
in
{
imports = [
./extras/kitty/auto-theme.nix
./extras/kitty/nerd-font.nix
];
programs.kitty = {
enable = true;
# using kitty from homebrew
package = pkgs.emptyDirectory;
settings = {
font_family = font;
bold_font = "${font} Bold";
italic_font = "${font} Italic";
bold_italic_font = "${font} Bold Italic";
font_size = "15.0";
adjust_line_height = "120%";
disable_ligatures = "cursor"; # disable ligatures when cursor is on them
hide_window_decorations = "titlebar-only";
window_padding_width = "10";
tab_bar_edge = "top";
tab_bar_style = "powerline";
tab_powerline_style = "angled";
tab_title_template = "{index}: {title}";
active_tab_font_style = "bold";
inactive_tab_font_style = "normal";
tab_activity_symbol = "💬";
# shell integration is manually enabled for fish
shell_integration = "disabled";
} // lib.optionalAttrs pkgs.stdenv.isDarwin { macos_option_as_alt = "both"; };
useSymbolsFromNerdFont = "CaskaydiaCove Nerd Font";
colors = {
enable = true;
dark-name = "rose-pine";
light-name = "rose-pine-dawn";
};
};
programs.fish = {
interactiveShellInit = ''
# 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
set-term-colors
'';
shellAliases = {
s = "kitty +kitten ssh";
e = "edit-in-kitty";
};
functions.set-term-colors = {
body = ''
if test "$term_background" = light
term-light
else
term-dark
end
'';
onVariable = "term_background";
};
};
}