nix-darwin/modules/aspects/_shell/starship.nix

227 lines
6 KiB
Nix
Executable file
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{lib, ...}: {
programs.starship = {
enable = true;
enableZshIntegration = true;
enableBashIntegration = true;
settings = {
add_newline = true;
continuation_prompt = "[ ](dimmed white)";
format = lib.concatStrings [
"($nix_shell$container$fill\n)$cmd_duration"
"$hostname"
"$localip"
"$shell"
"$env_var"
"$jobs"
"$sudo"
"$username"
"$character"
];
right_format = lib.concatStrings [
"$directory"
"$git_branch"
"$git_commit"
"$git_state"
"$git_status"
"$docker_context"
"$c"
"$cpp"
"$deno"
"$helm"
"$java"
"$kotlin"
"$gradle"
"$lua"
"$nodejs"
"$python"
"$ruby"
"$rust"
"$terraform"
"$conda"
"$pixi"
];
fill = {
symbol = " ";
};
line_break = {
disabled = false;
};
character = {
format = "$symbol ";
success_symbol = "[](bold italic bright-yellow)";
error_symbol = "[](italic purple)";
vimcmd_symbol = "[](italic dimmed green)";
};
env_var.VIMSHELL = {
format = "[$env_value]($style)";
style = "green italic";
};
sudo = {
format = "[$symbol]($style)";
style = "bold italic bright-purple";
symbol = "";
disabled = false;
};
username = {
style_user = "bright-yellow bold italic";
style_root = "purple bold italic";
format = "[ $user]($style) ";
disabled = false;
show_always = false;
};
directory = {
home_symbol = "";
truncation_length = 2;
truncation_symbol = " ";
read_only = " ";
use_os_path_sep = true;
style = "italic blue";
format = "[$path]($style)[$read_only]($read_only_style)";
repo_root_style = "bold blue";
repo_root_format = "[$before_root_path]($before_repo_root_style)[$repo_root]($repo_root_style)[$path]($style)[$read_only]($read_only_style) [](bold bright-blue)";
};
cmd_duration = {
format = "[ $duration ](italic white)";
};
jobs = {
format = "[$symbol$number]($style) ";
style = "white";
symbol = "[](blue italic)";
};
localip = {
ssh_only = true;
format = " [$localipv4](bold magenta)";
disabled = false;
};
git_branch = {
format = " [$branch(:$remote_branch)]($style)";
symbol = "[](bold italic bright-blue)";
style = "italic bright-blue";
truncation_symbol = "";
truncation_length = 11;
ignore_branches = [];
only_attached = true;
};
git_metrics = {
format = "([$added]($added_style))([$deleted]($deleted_style))";
added_style = "italic dimmed green";
deleted_style = "italic dimmed red";
ignore_submodules = true;
disabled = false;
};
git_status = {
style = "bold italic bright-blue";
format = "([$ahead_behind$staged$modified$untracked$renamed$deleted$conflicted$stashed]($style))";
conflicted = "[](italic bright-magenta)";
ahead = "[[\${count}](bold white)](italic green)";
behind = "[[\${count}](bold white)](italic red)";
diverged = "[ [\${ahead_count}](regular white)[\${behind_count}](regular white)](italic bright-magenta)";
untracked = "[](italic bright-yellow)";
stashed = "[](italic white)";
modified = "[](italic yellow)";
staged = "[[$count](bold white)](italic bright-cyan)";
renamed = "[](italic bright-blue)";
deleted = "[](italic red)";
};
deno = {
format = " [deno](italic) [ $version](green bold)";
version_format = "\${raw}";
};
lua = {
format = " [lua](italic) [\${symbol}\${version}]($style)";
version_format = "\${raw}";
symbol = " ";
style = "bold bright-yellow";
};
nodejs = {
format = " [node](italic) [ ($version)](bold bright-green)";
version_format = "\${raw}";
detect_files = [
"package-lock.json"
"yarn.lock"
];
detect_folders = ["node_modules"];
detect_extensions = [];
};
python = {
format = " [py](italic) [\${symbol}\${version}]($style)";
symbol = "[](bold bright-blue) ";
version_format = "\${raw}";
style = "bold bright-yellow";
};
ruby = {
format = " [rb](italic) [\${symbol}\${version}]($style)";
symbol = " ";
version_format = "\${raw}";
style = "bold red";
};
rust = {
format = " [rs](italic) [$symbol$version]($style)";
symbol = " ";
version_format = "\${raw}";
style = "bold red";
};
c = {
symbol = " ";
format = " [$symbol($version(-$name))]($style)";
};
cpp = {
symbol = " ";
format = " [$symbol($version(-$name))]($style)";
};
conda = {
symbol = " ";
format = " conda [$symbol$environment]($style)";
};
pixi = {
symbol = " ";
format = " pixi [$symbol$version ($environment )]($style)";
};
docker_context = {
symbol = " ";
format = " docker [$symbol$context]($style)";
};
java = {
symbol = " ";
format = " java [\${symbol}(\${version} )]($style)";
};
nix_shell = {
style = "bold italic dimmed blue";
symbol = "";
format = "[$symbol nix$state]($style) [$name](italic dimmed white)";
impure_msg = "[](bold dimmed red)";
pure_msg = "[](bold dimmed green)";
unknown_msg = "[](bold dimmed yellow)";
};
};
};
}