Configure alacritty shell, expand tmux config, and add bash prompt

- Alacritty: auto-attach to tmux session on launch
- tmux: full config with pane/window styling, TPM, and keybindings
- bash: add Powerline-style git-aware prompt via dotfiles/bash_prompt

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016fnKHtb2XA4Y5Pcxc1qpC2
This commit is contained in:
Leo Alho 2026-07-28 13:43:55 +03:00
parent 8e87efb6fe
commit 551f5c913a
2 changed files with 98 additions and 7 deletions

34
dotfiles/bash_prompt Normal file
View file

@ -0,0 +1,34 @@
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac
function __set_prompt() {
local branch
branch=$(git branch --show-current 2>/dev/null)
# Colors (wrapped in \[ \] for proper length calculation)
local yellow_bg='\[\033[43;30m\]'
local blue_bg='\[\033[44;30m\]'
local yellow_on_blue='\[\033[44;33m\]'
local blue='\[\033[0;34m\]'
local yellow='\[\033[0;33m\]'
local reset='\[\033[0m\]'
local arrow=$''
if [[ -n "$branch" ]]; then
PS1="${yellow_bg} \w ${yellow_on_blue}${arrow}${blue_bg} ${branch} ${blue}${arrow}${reset} "
else
PS1="${yellow_bg} \w ${yellow}${arrow}${reset} "
fi
}
if [ "$color_prompt" = yes ]; then
PROMPT_COMMAND=__set_prompt
else
PS1='\w\$ '
fi
unset color_prompt
printf '\033[3 q'

View file

@ -17,9 +17,12 @@
# Programs configured via `programs.<name>.enable` below are installed # Programs configured via `programs.<name>.enable` below are installed
# automatically, so they do not belong here. # automatically, so they do not belong here.
home.packages = [ home.packages = [
pkgs.gh pkgs.bubblewrap
pkgs.pi-coding-agent
pkgs.claude-code pkgs.claude-code
pkgs.gh
pkgs.jq
pkgs.nodejs_26
pkgs.pi-coding-agent
pkgs.proton-vpn pkgs.proton-vpn
pkgs.vscodium pkgs.vscodium
]; ];
@ -32,11 +35,15 @@
# This attribute set is translated into ~/.config/alacritty/alacritty.toml # This attribute set is translated into ~/.config/alacritty/alacritty.toml
settings = { settings = {
window = { window = {
padding = { x = 5; y = 5; }; padding = { x = 10; y = 10; };
decorations = "None"; decorations = "None";
}; };
colors.primary.background = "#000000"; colors.primary.background = "#000000";
font.size = 11; font.size = 11;
terminal.shell = {
program = "/bin/bash";
args = [ "-l" "-c" "tmux attach || tmux" ];
};
}; };
}; };
@ -45,13 +52,39 @@
############################################################################# #############################################################################
programs.tmux = { programs.tmux = {
enable = true; enable = true;
prefix = "C-a"; # replaces the unbind C-b / set prefix dance prefix = "C-a";
mouse = true; mouse = true;
extraConfig = '' extraConfig = ''
# Home Manager writes the config to ~/.config/tmux/tmux.conf bind r source-file ~/.tmux.conf \; display-message "RELOADING CONFIGURATION FILE"
bind r source-file ~/.config/tmux/tmux.conf \; display-message "RELOADING CONFIGURATION FILE"
set -g status-style bg=white,fg=black set -g status-style bg=white,fg=black
set -g window-active-style bg=black
set -g window-style bg=#212121
set -g pane-border-style fg=gray
set -g pane-border-lines heavy
set -g pane-active-border-style fg=yellow
set -g pane-border-status bottom
set -g pane-border-format ${"''"}
set -g window-status-current-format '[#I:#W]'
set -g window-status-format '#I:#W'
set -g window-status-current-style fg=yellow
set -g @plugin 'tmux-plugins/tpm'
set-option -g status-right ""
set-option -g status-left ""
set -g status-style bg=default
bind-key H display-popup -E "htop"
bind-key N display-popup -E 'tmux new-session -A -s scratch ~/go/bin/klod \; set status off'
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "~/Documents"
run '~/.tmux/plugins/tpm/tpm'
''; '';
}; };
@ -77,13 +110,37 @@
############################################################################# #############################################################################
programs.bash = { programs.bash = {
enable = true; enable = true;
promptInit = builtins.readFile ./dotfiles/bash_prompt;
shellAliases = { shellAliases = {
c = "clear"; c = "clear";
gcam = "git checkout master && git pull"; gm = "git checkout master && git pull";
count = "ls -1 | wc -l"; count = "ls -1 | wc -l";
}; };
}; };
#############################################################################
# Git
#############################################################################
programs.git = {
enable = true;
config.user = {
name = "Leo Alho";
email = "leoalho@proton.me";
};
lfs.enable = true;
settings.alias = {
co = "checkout";
br = "branch";
c = "commit";
a = "add";
p = "push";
st = "status";
};
extraConfig = {
init.defaultBranch = "main";
};
};
# Plain files that have no dedicated module can still be managed here, either # Plain files that have no dedicated module can still be managed here, either
# inline with `.text` or - preferably - from a file in dotfiles/: # inline with `.text` or - preferably - from a file in dotfiles/:
# #