{ inputs, ... }: { perSystem = { pkgs, ... }: let kittyConfig = '' # Font configuration font_family IosevkaTerm Nerd Font bold_font IosevkaTerm Nerd Font Bold italic_font IosevkaTerm Nerd Font Italic bold_italic_font IosevkaTerm Nerd Font Bold Italic font_size 12 # Window settings initial_window_width 80c initial_window_height 20c # Enable remote control for runtime theme switching allow_remote_control yes listen_on unix:/tmp/kitty-socket # Include theme colors from /var/theme/config include /var/theme/config/kitty-colors.conf # URL handling open_url_with /run/current-system/sw/bin/xdg-open detect_urls yes # Disable bell enable_audio_bell no # Don't reset the terminal on ctrl+shift+delete; it's too close to # shift+insert (paste) and the reset scrambles running programs. map ctrl+shift+delete no_op ''; # kitty only recognises `+kitten` as its first argument, so the config # must not be injected via `--config`: that would turn `kitty +kitten # icat` (nnn's image preview) into a terminal window trying to exec a # program called `+kitten`. KITTY_CONFIG_DIRECTORY leaves argv alone. configDir = pkgs.writeTextDir "kitty.conf" kittyConfig; # Color files consumed by switch-theme (configs/themes.nix) via # /etc/themes//kitty-colors.conf. themes = { # Gruvbox Light light = '' foreground #3c3836 background #f9f5d7 cursor #3c3836 cursor_text_color #f9f5d7 # Normal colors color0 #fbf1c7 color1 #cc241d color2 #98971a color3 #d79921 color4 #458588 color5 #b16286 color6 #689d6a color7 #7c6f64 # Bright colors color8 #928374 color9 #9d0006 color10 #79740e color11 #b57614 color12 #076678 color13 #8f3f71 color14 #427b58 color15 #3c3836 ''; dark = '' foreground #ffffff background #000000 cursor #ffffff cursor_text_color #F81CE5 # Normal colors color0 #000000 color1 #fe0100 color2 #33ff00 color3 #feff00 color4 #0066ff color5 #cc00ff color6 #00ffff color7 #d0d0d0 # Bright colors color8 #808080 color9 #fe0100 color10 #33ff00 color11 #feff00 color12 #0066ff color13 #cc00ff color14 #00ffff color15 #FFFFFF ''; }; in { packages.kitty = inputs.wrappers.lib.wrapPackage { inherit pkgs; package = pkgs.kitty; env.KITTY_CONFIG_DIRECTORY = "${configDir}"; passthru = { inherit themes; }; }; }; }