86 lines
2.1 KiB
Nix
Raw Permalink Normal View History

2024-04-20 09:42:06 -04:00
{
config,
pkgs,
lib,
...
}:
2025-01-20 22:35:40 -05:00
let
cfg = config.nmasur.presets.programs.starship;
in
2024-04-20 09:42:06 -04:00
{
2022-05-06 09:29:25 -04:00
2025-01-20 22:35:40 -05:00
options.nmasur.presets.programs.starship.enable = lib.mkEnableOption "Starship shell prompt";
config = lib.mkIf cfg.enable {
2025-02-02 21:45:34 -05:00
programs.starship = {
enable = true;
enableFishIntegration = true;
enableBashIntegration = true;
settings = {
add_newline = false; # Don't print new line at the start of the prompt
format = lib.concatStrings [
"$directory"
"$git_branch"
"$git_commit"
"$git_status"
"$hostname"
"$cmd_duration"
"$character"
];
right_format = "$nix_shell";
character = {
success_symbol = "[](bold green)";
error_symbol = "[](bold red)";
vicmd_symbol = "[](bold green)";
};
cmd_duration = {
min_time = 5000;
show_notifications = if pkgs.stdenv.isLinux then false else true;
min_time_to_notify = 30000;
format = "[$duration]($style) ";
};
directory = {
truncate_to_repo = true;
truncation_length = 100;
};
git_branch = {
format = "[$symbol$branch]($style)";
};
git_commit = {
format = "( @ [$hash]($style) )";
only_detached = false;
};
git_status = {
format = "([$all_status$ahead_behind]($style) )";
conflicted = "=";
ahead = "";
behind = "";
diverged = "";
untracked = "";
stashed = "";
modified = "";
staged = "+";
renamed = "»";
deleted = "";
style = "red";
};
hostname = {
ssh_only = true;
format = "on [$hostname](bold red) ";
};
nix_shell = {
format = "[$symbol $name]($style)";
symbol = "";
};
python = {
format = "[\${version}\\(\${virtualenv}\\)]($style)";
};
2024-04-20 09:42:06 -04:00
};
2022-05-06 09:29:25 -04:00
};
2025-01-20 22:35:40 -05:00
2022-05-06 09:29:25 -04:00
};
}