marleyos/modules/home/programs/starship/default.nix

81 lines
1.8 KiB
Nix
Raw Normal View History

2024-11-16 20:45:03 -08:00
{
lib,
config,
...
}:
let
inherit (lib)
mkIf
mkForce
concatStrings
;
inherit (lib.marleyos) mkEnableModule enabled;
2024-11-16 20:45:03 -08:00
cfg = config.marleyos.programs.starship;
inherit (config.marleyos.theme) colors;
2024-11-16 20:45:03 -08:00
in
{
2024-11-16 23:05:17 -08:00
options.marleyos = mkEnableModule "programs.starship";
2024-11-16 20:45:03 -08:00
imports = [
./nerd-font-symbols.nix
];
config = mkIf cfg.enable {
programs.starship = {
enable = true;
2024-11-16 22:44:45 -08:00
rose-pine = mkIf colors.isRosePine enabled;
2024-11-16 20:45:03 -08:00
settings = mkIf config.programs.starship.rose-pine.enabled {
format = mkForce (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 "
]);
character =
let
vim = "";
mkChar = sym: col: "[${sym}](fg:${col}) ";
in
{
success_symbol = mkChar "" "iris";
error_symbol = mkChar "󰋔" "love";
vimcmd_symbol = mkChar vim "rose";
vimcmd_replace_one_symbol = mkChar vim "gold";
vimcmd_replace_symbol = mkChar vim "gold";
vimcmd_visual_symbol = mkChar vim "iris";
};
nix_shell = {
format = "[](fg:overlay)[ $symbol $state( \($name\)) ]($style)[](fg:overlay) ";
style = "bg:overlay fg:foam";
};
git_branch.style = mkForce "bg:overlay fg:love";
git_status.style = mkForce "bg:overlay fg:rose";
time.style = mkForce "bg:overlay fg:gold";
};
};
};
}