This commit is contained in:
Harivansh Rathi 2026-03-12 18:38:43 -04:00
parent f74819de9d
commit 02c996d21a
11 changed files with 592 additions and 99 deletions

9
home/bat.nix Normal file
View file

@ -0,0 +1,9 @@
{...}: {
programs.bat = {
enable = true;
config = {
theme = "gruvbox-dark";
};
};
}

View file

@ -1,6 +1,10 @@
{...}: {
imports = [
./bat.nix
./dotfiles.nix
./ghostty.nix
./git.nix
./tmux.nix
];
home.stateVersion = "24.11";

View file

@ -15,16 +15,11 @@ in {
home.file.".aerospace.toml".source = link "aerospace/.aerospace.toml";
home.file.".gitconfig".source = link "git/.gitconfig";
home.file.".zshenv".source = link "zsh/.zshenv";
home.file.".zshrc".source = link "zsh/.zshrc";
home.file.".config/nvim".source = link "nvim/.config/nvim";
home.file.".config/tmux/tmux.conf".source = link "tmux/.config/tmux/tmux.conf";
home.file.".config/tmux/session-list.sh".source = link "tmux/.config/tmux/session-list.sh";
home.file.".config/karabiner/karabiner.json".source =
link "karabiner/.config/karabiner/karabiner.json";
@ -36,9 +31,6 @@ in {
home.file.".codex/AGENTS.md".source = link "codex/.codex/AGENTS.md";
home.file.".codex/config.toml".source = link "codex/.codex/config.toml";
home.file."Library/Application Support/com.mitchellh.ghostty/config".source =
link "ghostty/Library/Application Support/com.mitchellh.ghostty/config.ghostty";
home.file."Library/Application Support/lazygit/config.yml".source =
link "lazygit/Library/Application Support/lazygit/config.yml";
}

55
home/ghostty.nix Normal file
View file

@ -0,0 +1,55 @@
{pkgs, ...}: {
programs.ghostty = {
enable = true;
package = pkgs.ghostty-bin;
installBatSyntax = true;
settings = {
theme = "Gruvbox Material Dark";
"font-family" = "Berkeley Mono";
"font-codepoint-map" = "U+f101-U+f25c=nonicons";
"background-opacity" = 1;
"font-size" = 17;
"window-padding-y" = 0;
"window-padding-x" = 0;
"window-padding-color" = "extend";
"mouse-scroll-multiplier" = 1;
keybind = [
"global:alt+space=toggle_visibility"
"shift+enter=text:\\n"
"alt+v=activate_key_table:vim"
"vim/"
"vim/j=scroll_page_lines:1"
"vim/k=scroll_page_lines:-1"
"vim/ctrl+d=scroll_page_down"
"vim/ctrl+u=scroll_page_up"
"vim/ctrl+f=scroll_page_down"
"vim/ctrl+b=scroll_page_up"
"vim/shift+j=scroll_page_down"
"vim/shift+k=scroll_page_up"
"vim/g>g=scroll_to_top"
"vim/shift+g=scroll_to_bottom"
"vim/slash=start_search"
"vim/n=navigate_search:next"
"vim/v=copy_to_clipboard"
"vim/y=copy_to_clipboard"
"vim/shift+semicolon=toggle_command_palette"
"vim/escape=deactivate_key_table"
"vim/q=deactivate_key_table"
"vim/i=deactivate_key_table"
"vim/catch_all=ignore"
];
"mouse-hide-while-typing" = true;
"macos-titlebar-style" = "hidden";
"macos-option-as-alt" = true;
"confirm-close-surface" = true;
"window-title-font-family" = "VictorMono NFM Italic";
"window-padding-balance" = true;
"window-save-state" = "always";
"shell-integration-features" = true;
"copy-on-select" = "clipboard";
"focus-follows-mouse" = true;
"link-url" = true;
};
};
}

58
home/git.nix Normal file
View file

@ -0,0 +1,58 @@
{...}: {
programs.git = {
enable = true;
lfs.enable = true;
settings = {
user = {
name = "Harivansh Rathi";
email = "rathiharivansh@gmail.com";
};
advice.detachedHead = false;
core = {
pager = "diff-so-fancy | less --tabs=4 -RFX";
editor = "nvim";
};
interactive.diffFilter = "diff-so-fancy --patch";
color = {
ui = true;
"diff-highlight" = {
oldNormal = "red bold";
oldHighlight = "red bold 52";
newNormal = "green bold";
newHighlight = "green bold 22";
};
diff = {
meta = 11;
frag = "magenta bold";
func = "146 bold";
commit = "yellow bold";
old = "red bold";
new = "green bold";
whitespace = "red reverse";
};
};
delta = {
"syntax-theme" = "gruvbox-dark";
"hunk-header-style" = "omit";
"minus-style" = ''syntax "#3c1f1e"'';
"minus-emph-style" = ''syntax "#72261d"'';
"plus-style" = ''syntax "#1d2c1d"'';
"plus-emph-style" = ''syntax "#2b4a2b"'';
};
push.autoSetupRemote = true;
"diff-so-fancy" = {
markEmptyLines = true;
stripLeadingSymbols = true;
useUnicodeRuler = true;
};
};
};
}

139
home/tmux.nix Normal file
View file

@ -0,0 +1,139 @@
{...}: {
programs.tmux = {
enable = true;
extraConfig = ''
# custom
# Set prefix to C-b (default)
set -g prefix C-b
bind C-b send-prefix
set -g mouse on
# Enable extended keys so Shift+Enter and other modified keys work
set -s extended-keys on
set -as terminal-features 'xterm*:extkeys'
# Use Vim-style pane navigation (prefix + h/j/k/l)
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Switch sessions with prefix + H/J/K/L (capital)
bind H switch-client -p
bind J switch-client -n
bind K switch-client -p
bind L switch-client -n
# Switch sessions with prefix + H/J/K/L (capital)
bind J switch-client -n
bind K switch-client -p
bind H switch-client -p
bind L switch-client -n
# fzf pane switcher
bind f display-popup -w 80% -h 80% -E "\
tmux list-panes -a -F '#{session_name}:#{window_index}.#{pane_index} #{session_name}/#{window_name} [#{pane_current_command}] #{pane_current_path}' \
| fzf --reverse \
--preview 'tmux capture-pane -ep -t {1}' \
--preview-window right:60% \
| awk '{print \$1}' \
| xargs tmux switch-client -t"
# Auto-rename windows to the current running command
set -g automatic-rename on
set -g automatic-rename-format '#{pane_current_command}'
# Start all numbering at 1 instead of 0 for better key reachability
set-option -g base-index 1
set-option -g pane-base-index 1
set-option -g renumber-windows on
# Increase history limit, as we want an "almost" unlimited buffer.
set-option -g history-limit 100000
# Fix Terminal Title display, to not contain tmux specific information
set-option -g set-titles on
set-option -g set-titles-string "#{pane_title}"
# Open new windows and panes in the current working directory of the active pane.
bind c new-window -c "#{pane_current_path}"
bind - split-window -c "#{pane_current_path}"
bind "'" split-window -h -c "#{pane_current_path}"
# Enable support for terminal focus and extended keys.
set-option -s focus-events on
set-option -s extended-keys on
# Disable waiting time when pressing escape, for smoother Neovim usage.
set-option -s escape-time 0
# Styling
RED="#ea6962"
GREEN="#a9b665"
YELLOW="#d8a657"
BLUE="#7daea3"
MAGENTA="#d3869b"
CYAN="#89b482"
BLACK="#1d2021"
DARK_GRAY="#32302F"
LIGHT_GRAY="#4F4946"
BG="#32302F"
FG="#d4be98"
HALF_ROUND_OPEN="#(printf '\uE0B2')"
HALF_ROUND_CLOSE="#(printf '\uE0B0')"
TRIANGLE_OPEN="#(printf '\uE0B2')"
TRIANGLE_CLOSE="#(printf '\uE0B0')"
set-option -g status-position top
set-option -g status-style bg=''${BG},fg=''${FG}
set-option -g status-justify left
set-option -g status-left ""
set-option -g status-right "#(~/.config/tmux/session-list.sh)"
set-option -g status-left-length 100
set-option -g status-right-length 100
set-option -g window-status-format "\
\
#I\
#[fg=''${MAGENTA}]:\
#[fg=default]#W\
\
"
set-option -g window-status-current-format "\
#[bg=''${LIGHT_GRAY},fg=default] #I\
#[fg=''${RED}]:\
#[fg=default]#W \
#[bg=default]\
"
set-option -g window-status-separator ""
# Plugins (TPM)
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @continuum-save-interval '10'
run '~/.tmux/plugins/tpm/tpm'
'';
};
home.file.".config/tmux/session-list.sh" = {
executable = true;
text = ''
#!/bin/sh
current=$(tmux display-message -p '#S')
tmux list-sessions -F '#S' | while IFS= read -r s; do
if [ "$s" = "$current" ]; then
printf '#[bg=#4F4946,fg=#d8a657] %s #[bg=default,fg=default]' "$s"
else
printf ' %s ' "$s"
fi
done
'';
};
}