dotfiles/home/modules/cli/shell/starship/config/settings.nix

87 lines
2.1 KiB
Nix
Raw Normal View History

2024-11-20 17:47:07 -06:00
{
2024-12-19 19:56:45 -06:00
flake,
lib,
...
2025-01-18 03:50:54 -06:00
}:
let
inherit (flake.config.aesthetics.themes)
currentThemes
2025-01-18 03:50:54 -06:00
palettes
2025-01-08 19:06:14 -06:00
;
2025-01-18 03:50:54 -06:00
el = palettes.${currentThemes.theme0}.colours;
2025-01-18 03:50:54 -06:00
makeColor = c: "#" + c;
makeStyle = bg: fg: "bg:" + bg + " fg:" + fg + " bold";
surround =
fg: text:
2025-01-08 19:06:14 -06:00
"[](fg:"
2025-01-18 03:50:54 -06:00
+ makeColor el.base00
2025-01-08 19:06:14 -06:00
+ " bg:"
+ fg
+ ")"
+ "[](fg:"
+ fg
+ ")"
+ text
+ "[](fg:"
+ fg
+ ")";
2025-01-18 03:50:54 -06:00
in
{
2025-01-08 01:05:45 -06:00
add_newline = false;
2025-01-18 03:50:54 -06:00
character =
let
makeChar =
bg: c:
surround (makeColor bg) ("[" + c + "](" + makeStyle (makeColor bg) (makeColor el.base11) + ")");
in
{
error_symbol = makeChar el.base12 "";
format = "$symbol";
success_symbol = makeChar el.base0C "λ";
};
2025-01-08 01:05:45 -06:00
cmd_duration = {
2025-01-18 03:50:54 -06:00
format = surround (makeColor el.base0E) "[ $duration]($style)";
2025-01-08 01:05:45 -06:00
min_time = 0;
show_milliseconds = true;
2025-01-18 03:50:54 -06:00
style = makeStyle (makeColor el.base0E) (makeColor el.base11);
2025-01-08 01:05:45 -06:00
};
directory = {
2025-01-18 03:50:54 -06:00
format = surround (makeColor el.base0D) "[󰉋 $path]($style)[$read_only]($read_only_style)";
2025-01-08 01:05:45 -06:00
read_only = " ";
2025-01-18 03:50:54 -06:00
read_only_style = makeStyle (makeColor el.base0D) (makeColor el.base11);
style = makeStyle (makeColor el.base0D) (makeColor el.base11);
2025-01-08 01:05:45 -06:00
truncation_length = 1;
truncate_to_repo = false;
};
git_branch = {
2025-01-18 03:50:54 -06:00
format = surround (makeColor el.base09) "[$symbol $branch]($style)";
style = makeStyle (makeColor el.base09) (makeColor el.base11);
2025-01-08 01:05:45 -06:00
symbol = "";
};
git_status = {
format = "[ \\[$all_status$ahead_behind\\]]($style)";
2025-01-18 03:50:54 -06:00
style = makeStyle (makeColor el.base0A) (makeColor el.base11);
2025-01-08 01:05:45 -06:00
};
hostname = {
2025-01-18 03:50:54 -06:00
format = surround (makeColor el.base16) "[$ssh_symbol$hostname]($style)";
2025-01-08 01:05:45 -06:00
ssh_symbol = "󰖟 ";
2025-01-18 03:50:54 -06:00
style = makeStyle (makeColor el.base16) (makeColor el.base11);
2025-01-08 01:05:45 -06:00
};
pijul_channel = {
disabled = false;
2025-01-18 03:50:54 -06:00
format = surround (makeColor el.base09) "[$symbol $channel]($style)";
style = makeStyle (makeColor el.base09) (makeColor el.base11);
2025-01-08 01:05:45 -06:00
symbol = "";
};
format = lib.concatStrings [
"$hostname"
"$directory"
"$pijul_channel"
"$git_branch"
"$cmd_duration"
"$character "
];
2024-11-20 17:47:07 -06:00
}