marleyos/modules/home/programs/cli/starship/theme.nix

202 lines
5.9 KiB
Nix
Raw Normal View History

{
lib,
config,
...
}: let
inherit (lib) mkDefault;
cfg = config.marleyos.programs.starship;
in {
2025-03-02 18:41:56 +00:00
config = lib.mkIf cfg.enable {
2025-03-02 20:04:19 +00:00
programs.starship.settings = with config.lib.stylix.colors.withHashtag; let
mkFormat = t: " [](fg:${base02})[${t}]($style)[](fg:${base02}) ";
langFormat = mkFormat "$symbol$version";
in {
format = mkDefault (lib.concatStrings [
"$username"
"$directory"
"$nix_shell"
"$git_branch"
"$git_status"
"$fill"
"$c"
"$elixir"
"$elm"
"$golang"
"$haskell"
"$java"
"$julia"
"$nodejs"
"$nim"
"$rust"
"$scala"
"$python"
"$time"
"$line_break"
"$character"
]);
username = {
disabled = mkDefault false;
format = mkDefault (mkFormat " 󰧱 $user ");
show_always = mkDefault true;
2025-03-02 20:04:19 +00:00
style_root = mkDefault "bg:${base02} fg:${base0D}";
style_user = mkDefault "bg:${base02} fg:${base0D}";
};
directory = {
format = mkDefault (mkFormat " $path ");
2025-03-02 20:04:19 +00:00
style = mkDefault "bg:${base02} fg:${base0B}";
truncation_length = mkDefault 3;
truncation_symbol = mkDefault "/";
substitutions = {
Documents = mkDefault "󰈙";
Downloads = mkDefault " ";
Music = mkDefault " ";
Pictures = mkDefault " ";
};
};
git_branch = {
format = mkDefault (mkFormat " $symbol $branch ");
2025-03-02 20:04:19 +00:00
style = mkDefault "bg:${base02} fg:${base0C}";
symbol = mkDefault "";
};
git_status = {
disabled = mkDefault false;
2025-03-02 20:04:19 +00:00
style = mkDefault "bg:${base02} fg:${base08}";
format = mkDefault (mkFormat " $all_status$ahead_behind");
2025-03-02 20:04:19 +00:00
up_to_date = mkDefault "[ ](bg:${base02} fg:${base0D})";
untracked = mkDefault "[?\\($count\\)](bg:${base02} fg:${base09})";
stashed = mkDefault "[\\$](bg:${base02} fg:${base0D})";
modified = mkDefault "[!\\($count\\)](bg:${base02} fg:${base09})";
renamed = mkDefault "[»\\($count\\)](bg:${base02} fg:${base0D})";
deleted = mkDefault "[\\($count\\)](style)";
2025-03-02 20:04:19 +00:00
staged = mkDefault "[++\\($count\\)](bg:${base02} fg:${base09})";
ahead = mkDefault "[\\(\${count}\\)](bg:${base02} fg:${base0C})";
diverged = mkDefault "[\\[](bg:${base02} fg:${base0D})[\\(\${ahead_count}\\)](bg:${base02} fg:${base0C})[\\(\${behind_count}\\)](bg:${base02} fg:${base0A})[\\]](bg:${base02} fg:${base0D})";
behind = mkDefault "[\\(\${count}\\)](bg:${base02} fg:${base0A})";
};
fill = {
2025-03-02 20:04:19 +00:00
style = mkDefault "fg:${base02}";
symbol = mkDefault " ";
};
time = {
disabled = mkDefault false;
format = mkDefault (mkFormat " $time 󰴈 ");
2025-03-02 20:04:19 +00:00
style = mkDefault "bg:${base02} fg:${base0A}";
time_format = mkDefault "%I:%M%P";
use_12hr = mkDefault true;
};
character = let
vim = "";
2025-03-02 20:04:19 +00:00
mkChar = sym: col: " [${sym}](fg:${col}) [󰄾](fg:${base0C})";
in {
2025-03-02 20:04:19 +00:00
success_symbol = mkChar "" "${base0D}";
error_symbol = mkChar "󰋔" "${base08}";
vimcmd_symbol = mkChar vim "${base0A}";
vimcmd_replace_one_symbol = mkChar vim "${base0C}";
vimcmd_replace_symbol = mkChar vim "${base0C}";
vimcmd_visual_symbol = mkChar vim "${base0D}";
};
### Languages ###
c = {
2025-03-02 20:04:19 +00:00
style = mkDefault "bg:${base02} fg:${base0B}";
format = mkDefault langFormat;
disabled = mkDefault false;
symbol = mkDefault " ";
};
elixir = {
2025-03-02 20:04:19 +00:00
style = mkDefault "bg:${base02} fg:${base0B}";
format = mkDefault langFormat;
disabled = mkDefault false;
symbol = mkDefault " ";
};
elm = {
2025-03-02 20:04:19 +00:00
style = mkDefault "bg:${base02} fg:${base0B}";
format = mkDefault langFormat;
disabled = mkDefault false;
symbol = mkDefault " ";
};
haskell = {
2025-03-02 20:04:19 +00:00
style = mkDefault "bg:${base02} fg:${base0B}";
format = mkDefault langFormat;
disabled = mkDefault false;
symbol = mkDefault " ";
};
java = {
2025-03-02 20:04:19 +00:00
style = mkDefault "bg:${base02} fg:${base0B}";
format = mkDefault langFormat;
disabled = mkDefault false;
symbol = mkDefault " ";
};
julia = {
2025-03-02 20:04:19 +00:00
style = mkDefault "bg:${base02} fg:${base0B}";
format = mkDefault langFormat;
disabled = mkDefault false;
symbol = mkDefault " ";
};
nodejs = {
2025-03-02 20:04:19 +00:00
style = mkDefault "bg:${base02} fg:${base0B}";
format = mkDefault langFormat;
disabled = mkDefault false;
symbol = mkDefault "󰎙 ";
};
nim = {
2025-03-02 20:04:19 +00:00
style = mkDefault "bg:${base02} fg:${base0B}";
format = mkDefault langFormat;
disabled = mkDefault false;
symbol = mkDefault "󰆥 ";
};
python = {
2025-03-02 20:04:19 +00:00
style = mkDefault "bg:${base02} fg:${base0B}";
disabled = mkDefault false;
symbol = mkDefault " ";
};
rust = {
2025-03-02 20:04:19 +00:00
style = mkDefault "bg:${base02} fg:${base0B}";
format = mkDefault langFormat;
disabled = mkDefault false;
symbol = mkDefault "";
};
scala = {
2025-03-02 20:04:19 +00:00
style = "bg:${base02} fg:${base0B}";
format = mkDefault langFormat;
disabled = false;
symbol = " ";
};
### Tools ###
conda = {
2025-03-02 20:04:19 +00:00
style = mkDefault "bg:${base02} fg:${base0B}";
format = mkDefault (mkFormat "$symbol$environment");
disabled = mkDefault false;
symbol = mkDefault "🅒 ";
};
nix_shell = {
2025-03-02 20:04:19 +00:00
style = "bg:${base02} fg:${base0C}";
format = mkDefault (mkFormat " $symbol $state( \($name\)) ");
disabled = mkDefault false;
symbol = mkDefault " ";
};
};
};
}