nix-config/home-manager/sajenim/features/cli/starship.nix
jasmine bdf7c14c6c
feat(home-manager): add starship prompt and reorganize CLI features
- Move zsh configuration from global/ to features/cli/
- Add starship.nix with custom prompt configuration
  - Left prompt: username@hostname, directory, git status, vi-mode indicator
  - Right prompt: language/environment indicators (C, direnv, Haskell, Bun, Python, Rust)
  - Git status with semantic colors (green=staged, yellow=modified/untracked, red=conflicted/deleted, cyan=stashed/renamed)
  - Vi-mode aware prompt character (red heart in insert, blue in normal)
- Update features/cli to import starship via zsh.nix
- Remove empty imports section from global/default.nix
2025-10-25 23:14:17 +08:00

70 lines
1.9 KiB
Nix

{...}: {
programs.starship = {
enable = true;
enableZshIntegration = true;
settings = {
# Left prompt: username@hostname directory git ♥
format = "$username$hostname$directory$git_branch$git_status$character";
# Right prompt: language indicators
right_format = "$c$direnv$haskell$bun$python$rust";
# Blue username
username = {
style_user = "blue";
style_root = "red";
format = "[$user]($style)";
show_always = true;
};
# Blue @hostname
hostname = {
ssh_only = false;
format = "[@$hostname]($style) ";
style = "blue";
};
# Cyan directory
directory = {
style = "cyan";
format = "[$path]($style) ";
truncation_length = 0;
truncate_to_repo = false;
};
# Git branch (purple, no bold)
git_branch = {
style = "purple";
};
# Git status with semantic colors (no bold, no brackets)
git_status = {
format = "$conflicted$stashed$deleted$renamed$modified$staged$untracked$ahead_behind";
conflicted = "[=$count](red) ";
ahead = "[$count](cyan) ";
behind = "[$count](cyan) ";
diverged = "[$ahead_count](cyan)[$behind_count](cyan) ";
untracked = "[?$count](yellow) ";
stashed = "[\\$$count](cyan) ";
modified = "[!$count](yellow) ";
staged = "[+$count](green) ";
renamed = "[»$count](cyan) ";
deleted = "[$count](red) ";
};
# Heart prompt character (red in insert mode, blue in normal mode)
character = {
success_symbol = "[](red)";
error_symbol = "[](red)";
vicmd_symbol = "[](blue)";
};
# Language modules for right prompt (only configure non-defaults)
# Enable direnv (disabled by default)
direnv.disabled = false;
# C, Python, Haskell, Bun, Rust: use defaults
};
};
}