From baae94abb6a9a03914216f0f373b7b0f6b0207bd Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Sat, 19 Sep 2026 01:40:50 +0530 Subject: chore: removed all raw string configurations options in favor of files Moved all configurations which were previously raw strings chunks, for options that the home-manager options didn't provide, into files for that specific configuration and reading there contents instead (with string replacement for passing information from the rest of the configuration). --- modules/terminal/kitty/default.nix | 20 +------------------- modules/terminal/kitty/kitty.conf | 17 +++++++++++++++++ modules/terminal/zsh/default.nix | 19 +++---------------- modules/terminal/zsh/init.sh | 14 ++++++++++++++ 4 files changed, 35 insertions(+), 35 deletions(-) create mode 100644 modules/terminal/kitty/kitty.conf create mode 100644 modules/terminal/zsh/init.sh (limited to 'modules/terminal') diff --git a/modules/terminal/kitty/default.nix b/modules/terminal/kitty/default.nix index d840667..f72f862 100644 --- a/modules/terminal/kitty/default.nix +++ b/modules/terminal/kitty/default.nix @@ -26,25 +26,7 @@ in programs.kitty = { enable = true; - extraConfig = '' - # Keep normal clicks for selection and prompt placement; Ctrl+click opens links. - mouse_map left click ungrabbed mouse_handle_click selection prompt - mouse_map ctrl+left click grabbed,ungrabbed mouse_handle_click link - - # Vim-style navigation between Kitty windows in the current tab. - map ctrl+shift+h neighboring_window left - map ctrl+shift+j neighboring_window bottom - map ctrl+shift+k neighboring_window top - map ctrl+shift+l neighboring_window right - - # Line scrolling - map ctrl+shift+j scroll_line_down - map ctrl+shift+k scroll_line_up - - # Page scrolling (half-page / full-page) - map ctrl+shift+u scroll_page_up - map ctrl+shift+d scroll_page_down - ''; + extraConfig = builtins.readFile ./kitty.conf; settings = with base16Colors.colorsWithHashPrefix; { window_padding_width = 10; font_size = config.fonts.size; diff --git a/modules/terminal/kitty/kitty.conf b/modules/terminal/kitty/kitty.conf new file mode 100644 index 0000000..c55fbce --- /dev/null +++ b/modules/terminal/kitty/kitty.conf @@ -0,0 +1,17 @@ +# Keep normal clicks for selection and prompt placement; Ctrl+click opens links. +mouse_map left click ungrabbed mouse_handle_click selection prompt +mouse_map ctrl+left click grabbed,ungrabbed mouse_handle_click link + +# Vim-style navigation between Kitty windows in the current tab. +map ctrl+shift+h neighboring_window left +map ctrl+shift+j neighboring_window bottom +map ctrl+shift+k neighboring_window top +map ctrl+shift+l neighboring_window right + +# Line scrolling +map ctrl+shift+j scroll_line_down +map ctrl+shift+k scroll_line_up + +# Page scrolling (half-page / full-page) +map ctrl+shift+u scroll_page_up +map ctrl+shift+d scroll_page_down diff --git a/modules/terminal/zsh/default.nix b/modules/terminal/zsh/default.nix index 0f0471c..8b7897c 100644 --- a/modules/terminal/zsh/default.nix +++ b/modules/terminal/zsh/default.nix @@ -25,22 +25,9 @@ dotDir = "${config.xdg.configHome}/zsh"; history.path = "${config.xdg.cacheHome}/zsh/history"; enableCompletion = true; - initContent = '' - setopt PROMPT_SUBST - - # Vi insert/command modes for command-line editing. Escape enters normal mode. - bindkey -v - KEYTIMEOUT=1 - - autoload -U colors && colors - - export GPG_TTY="$(tty)" - gpg-connect-agent updatestartuptty /bye >/dev/null 2>&1 - - bindkey "^[[3~" delete-char - bindkey "^?" backward-delete-char - ${nixCommandWrappers} - ''; + initContent = builtins.replaceStrings [ "@@NIX_COMMAND_WRAPPERS@@" ] [ nixCommandWrappers ] ( + builtins.readFile ./init.sh + ); }; home.sessionVariables.SHELL = "${lib.getExe config.terminal.zsh.package}"; diff --git a/modules/terminal/zsh/init.sh b/modules/terminal/zsh/init.sh new file mode 100644 index 0000000..b44895c --- /dev/null +++ b/modules/terminal/zsh/init.sh @@ -0,0 +1,14 @@ +setopt PROMPT_SUBST + +# Vi insert/command modes for command-line editing. Escape enters normal mode. +bindkey -v +KEYTIMEOUT=1 + +autoload -U colors && colors + +export GPG_TTY="$(tty)" +gpg-connect-agent updatestartuptty /bye >/dev/null 2>&1 + +bindkey "^[[3~" delete-char +bindkey "^?" backward-delete-char +@@NIX_COMMAND_WRAPPERS@@ -- cgit v1.2.3