config/modules/home/apps/tools/starship/default.nix

84 lines
2 KiB
Nix
Raw Normal View History

2024-05-23 20:26:30 +00:00
{
options,
config,
lib,
pkgs,
...
}:
2024-11-13 20:35:13 -05:00
with lib; let
2024-05-23 20:26:30 +00:00
cfg = config.apps.tools.starship;
in {
options.apps.tools.starship = with types; {
2024-11-13 20:35:13 -05:00
enable = mkEnableOption "Starship prompt";
2024-05-23 20:26:30 +00:00
};
config = mkIf cfg.enable {
programs.starship = {
enable = true;
enableZshIntegration = config.programs.zsh.enable;
2025-05-19 18:28:46 -04:00
enableNushellIntegration = config.programs.nushell.enable;
2024-05-23 20:26:30 +00:00
settings = {
add_newline = false;
2024-11-13 20:35:13 -05:00
format = "$username$directory$git_branch$git_status$python$rust$nodejs$nix_shell$cmd_duration$line_break$character";
# Username display
username = {
style_user = "blue bold";
style_root = "red bold";
format = "[$user]($style) ";
show_always = true;
};
# Modern minimal prompt character
2024-05-23 20:26:30 +00:00
character = {
2024-11-13 20:35:13 -05:00
success_symbol = "[>](blue)";
error_symbol = "[>](red)";
};
2024-11-13 20:35:13 -05:00
# Simplified directory display
directory = {
truncation_length = 1;
2024-11-13 20:35:13 -05:00
style = "bold lavender";
format = "[$path]($style) ";
read_only = " ";
};
# Streamlined git status indicators
git_branch = {
format = "[$symbol$branch]($style) ";
style = "mauve";
2024-05-23 20:26:30 +00:00
};
2024-11-13 20:35:13 -05:00
git_status = {
2024-11-13 20:35:13 -05:00
format = "[$all_status$ahead_behind]($style) ";
style = "bold peach";
conflicted = "=";
ahead = "";
behind = "";
diverged = "";
untracked = "?";
stashed = "$";
modified = "!";
staged = "+";
renamed = "»";
deleted = "";
};
2024-11-13 20:35:13 -05:00
# Language modules with minimal styling
python.symbol = "[](yellow) ";
rust.symbol = "[](peach) ";
nodejs.symbol = "[](green) ";
nix_shell.symbol = "[](blue) ";
# Command duration and line break
cmd_duration = {
format = "[$duration]($style) ";
style = "yellow";
};
2024-11-13 20:35:13 -05:00
2024-05-23 20:26:30 +00:00
line_break.disabled = false;
};
};
};
}