2025-01-27 23:30:24 +01:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}: let
|
2025-02-10 19:02:35 +01:00
|
|
|
inherit (lib.strings) concatStrings;
|
2025-01-27 23:30:24 +01:00
|
|
|
toTOML = (pkgs.formats.toml {}).generate;
|
2025-02-10 19:02:35 +01:00
|
|
|
inherit (config.local.systemVars) username;
|
2025-01-27 23:30:24 +01:00
|
|
|
in {
|
|
|
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
|
|
|
hjem.users.${username} = {
|
|
|
|
packages = [pkgs.starship];
|
|
|
|
files = {
|
2025-02-10 19:02:35 +01:00
|
|
|
".config/starship.toml".source = toTOML "starship config" {
|
2025-01-27 23:30:24 +01:00
|
|
|
add_newline = true;
|
|
|
|
directory = {
|
|
|
|
style = "bold yellow";
|
|
|
|
};
|
|
|
|
character = {
|
|
|
|
format = "$symbol ";
|
|
|
|
success_symbol = "[➜](bold green)";
|
|
|
|
error_symbol = "[✗](bold red)";
|
|
|
|
};
|
|
|
|
cmd_duration = {
|
|
|
|
style = "yellow";
|
|
|
|
format = "[ $duration]($style)";
|
|
|
|
};
|
2025-02-10 19:02:35 +01:00
|
|
|
# https://github.com/llakala/nixos/blob/6e840f11d19e59b49e7ba9573f1398830799758a/apps/core/starship/git_status.nix
|
|
|
|
git_status = {
|
|
|
|
modified = "M";
|
|
|
|
staged = "S";
|
|
|
|
untracked = "A";
|
|
|
|
renamed = "R";
|
|
|
|
deleted = "D";
|
|
|
|
conflicted = "U";
|
|
|
|
|
|
|
|
ahead = "[+$count](green)";
|
|
|
|
behind = "[-$count](red)";
|
|
|
|
diverged = "[+$ahead_count](green),[-$behind_count](red)";
|
|
|
|
|
|
|
|
style = "white";
|
|
|
|
|
|
|
|
# referenced from https://github.com/clotodex/nix-config/blob/c878ff5d5ae674b49912387ea9253ce985cbd3cd/shell/starship.nix#L82
|
|
|
|
format =
|
|
|
|
concatStrings
|
|
|
|
[
|
|
|
|
"[("
|
|
|
|
|
|
|
|
"(\\["
|
|
|
|
"[($conflicted)](orange)"
|
|
|
|
"[($stashed)](white)"
|
|
|
|
"[($staged)](blue)"
|
|
|
|
"[($deleted)](red)"
|
|
|
|
"[($renamed)](yellow)"
|
|
|
|
"[($modified)](yellow)"
|
|
|
|
"[($untracked)](green)"
|
|
|
|
"\\])"
|
|
|
|
|
|
|
|
"( \\[$ahead_behind\\])"
|
|
|
|
|
|
|
|
" )]"
|
|
|
|
"($style)"
|
|
|
|
];
|
|
|
|
};
|
2025-01-27 23:30:24 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|