From 9f728ed6de7fa11f1da053112115951d4012bfd0 Mon Sep 17 00:00:00 2001 From: Tim McCarthy Date: Tue, 6 Sep 2022 13:07:16 -0700 Subject: [PATCH] Move kitty config into Nix --- TODO.org | 1 - nix/home.nix | 2 +- nix/modules/dotfiles.nix | 1 - nix/modules/kitty/current-theme.conf | 59 ++++++++++++++++++++++++++++ nix/modules/kitty/default.nix | 41 +++++++++++++++++++ 5 files changed, 101 insertions(+), 3 deletions(-) create mode 100644 nix/modules/kitty/current-theme.conf create mode 100644 nix/modules/kitty/default.nix diff --git a/TODO.org b/TODO.org index 5fcb038..8ccb72d 100644 --- a/TODO.org +++ b/TODO.org @@ -14,7 +14,6 @@ https://karthinks.com/software/fifteen-ways-to-use-embark/ figure out interactions with Doom ** configure evil-surround to not put spaces in * Kitty -** Migrate kitty config to Nix ** Toggle zoom pane C-s>z ** Layout shortcuts diff --git a/nix/home.nix b/nix/home.nix index b823c4a..1acf5f8 100644 --- a/nix/home.nix +++ b/nix/home.nix @@ -24,12 +24,12 @@ ncdu ripgrep tmux - kitty fira-code ]; imports = [ ./modules/fish + ./modules/kitty ./modules/git.nix ./modules/direnv.nix ./modules/emacs.nix diff --git a/nix/modules/dotfiles.nix b/nix/modules/dotfiles.nix index 9759d5d..8385453 100644 --- a/nix/modules/dotfiles.nix +++ b/nix/modules/dotfiles.nix @@ -9,7 +9,6 @@ in "tmux/tmux.conf".source = ../../tmux.conf; "vim/vimrc".source = ../../vimrc; "ideavim/ideavimrc".source = ../../ideavimrc; - "kitty".source = mkOutOfStoreSymlink "${dotdir}/kitty"; "doom".source = mkOutOfStoreSymlink "${dotdir}/doom"; }; } diff --git a/nix/modules/kitty/current-theme.conf b/nix/modules/kitty/current-theme.conf new file mode 100644 index 0000000..5057b8a --- /dev/null +++ b/nix/modules/kitty/current-theme.conf @@ -0,0 +1,59 @@ +# vim:ft=kitty + +## name: Doom Vibrant +## author: Henrik Lissner +## license: MIT +## blurb: A version of Doom One Emacs theme that uses more vibrant colors. + +# The basic colors +foreground #bbc2cf +background #242730 +selection_foreground #bbc2cf +selection_background #6A8FBF + +# Cursor colors +cursor #bbc2cf +cursor_text_color #242730 + +# kitty window border colors +active_border_color #46D9FF +inactive_border_color #484854 + +# Tab bar colors +active_tab_foreground #242730 +active_tab_background #DFDFDF +inactive_tab_foreground #484854 +inactive_tab_background #5D656B + +# The basic 16 colors +# black +color0 #2a2e38 +color8 #484854 + +# red +color1 #ff665c +color9 #ff665c + +# green +color2 #7bc275 +color10 #99bb66 + +# yellow +color3 #fcce7b +color11 #ecbe7b + +# blue +color4 #51afef +color12 #51afef + +# magenta +color5 #C57BDB +color13 #c678dd + +# cyan +color6 #5cEfFF +color14 #46D9FF + +# white +color7 #DFDFDF +color15 #bbc2cf diff --git a/nix/modules/kitty/default.nix b/nix/modules/kitty/default.nix new file mode 100644 index 0000000..e8a11c5 --- /dev/null +++ b/nix/modules/kitty/default.nix @@ -0,0 +1,41 @@ +{ config, lib, pkgs, ... }: +{ + programs.kitty = { + enable = true; + + settings = { + enabled_layouts = "vertical, tall, grid"; + background_opacity = "1.0"; + macos_option_as_alt = "left"; + }; + + font = { + package = pkgs.fira-code; + name = "Fira Code"; + size = 14; + }; + + keybindings = { + "kitty_mod+enter" = "launch --cwd=current"; + + "kitty_mod+h" = "neighboring_window left"; + "kitty_mod+j" = "neighboring_window down"; + "kitty_mod+k" = "neighboring_window up"; + "kitty_mod+l" = "neighboring_window right"; + + "ctrl+s>l" = "next_layout"; + "ctrl+s>h" = "show_scrollback"; + "ctrl+page_down" = "next_tab"; + "ctrl+page_up" = "previous_tab"; + "ctrl+shift+page_down" = "move_tab_forward"; + "ctrl+shift+page_up" = "move_tab_backward"; + }; + + extraConfig = '' + include ${./current-theme.conf} + + mouse_map left click ungrabbed no-op + mouse_map ctrl+shift+left click ungrabbed mouse_click + ''; + }; +}