73 lines
2 KiB
Nix
73 lines
2 KiB
Nix
{ lib, config, ... }:
|
||
with lib;
|
||
let
|
||
cfg = config.modules.cli.starship;
|
||
in
|
||
{
|
||
options.modules.cli.starship = {
|
||
enable = mkEnableOption "enable starship prompt";
|
||
};
|
||
config = mkIf cfg.enable {
|
||
programs.starship = {
|
||
enable = true;
|
||
enableZshIntegration = true;
|
||
settings = {
|
||
format = "$username$hostname$directory$kubernetes$git_branch$git_state$git_status$cmd_duration$line_break$python$nix_shell$character";
|
||
directory = {
|
||
style = "blue";
|
||
truncate_to_repo = false;
|
||
truncation_length = 6;
|
||
truncation_symbol = "…/";
|
||
read_only = " ";
|
||
format = "[$read_only]($read_only_style)[$path]($style) ";
|
||
};
|
||
character = {
|
||
success_symbol = "[](green)";
|
||
error_symbol = "[](red)";
|
||
vimcmd_symbol = "[](blue)";
|
||
};
|
||
git_branch = {
|
||
format = "[$branch]($style)";
|
||
style = "bright-black";
|
||
};
|
||
git_status = {
|
||
format = "[[(*$conflicted$untracked$modified$staged$renamed$deleted)](218) ($ahead_behind$stashed)]($style) ";
|
||
style = "cyan";
|
||
conflicted = "";
|
||
untracked = "";
|
||
modified = "";
|
||
staged = "";
|
||
renamed = "";
|
||
deleted = "";
|
||
stashed = "≡";
|
||
};
|
||
git_state = {
|
||
format = "\\([$state( $progress_current/$progress_total)]($style)\\)";
|
||
style = "bright-black";
|
||
};
|
||
cmd_duration = {
|
||
format = "[$duration]($style) ";
|
||
style = "yellow";
|
||
};
|
||
python = {
|
||
format = "[$virtualenv]($style) ";
|
||
style = "bright-black";
|
||
};
|
||
nix_shell = {
|
||
format = "[$symbol$name]($style) ";
|
||
symbol = " ";
|
||
style = "bright-black";
|
||
};
|
||
kubernetes = {
|
||
format = "[$symbol$cluster ]($style)";
|
||
symbol = "";
|
||
style = "dimmed blue";
|
||
disabled = false;
|
||
};
|
||
fill = {
|
||
symbol = " ";
|
||
};
|
||
};
|
||
};
|
||
};
|
||
}
|