diff --git a/home/terminal/shell/fish.nix b/home/terminal/shell/fish.nix index e623701..c96824a 100644 --- a/home/terminal/shell/fish.nix +++ b/home/terminal/shell/fish.nix @@ -1,10 +1,28 @@ -{pkgs, ...}: { +{ + config, + pkgs, + lib, + ... +}: let + starshipTransient = lib.strings.optionalString config.programs.starship.enableTransience '' + function starship_transient_prompt_func + starship module character + end + + function starship_transient_rprompt_func + starship module cmd_duration + end + ''; +in { programs.fish = { enable = true; - interactiveShellInit = '' - set fish_greeting # Disable greeting - fish_vi_key_bindings # Enable Vi mode - ''; + interactiveShellInit = + starshipTransient + + '' + set fish_greeting # Disable greeting + fish_vi_key_bindings # Enable Vi mode + + ''; shellAbbrs = { cd = "z"; ngc = "sudo nix-collect-garbage -d"; diff --git a/home/terminal/shell/starship.nix b/home/terminal/shell/starship.nix index fc95e4e..ebbf7ec 100644 --- a/home/terminal/shell/starship.nix +++ b/home/terminal/shell/starship.nix @@ -2,5 +2,13 @@ programs.starship = { enable = true; enableTransience = true; + settings = { + add_newline = true; + + cmd_duration = { + style = "yellow"; + format = "[ $duration]($style)"; + }; + }; }; }