terminal/shell: add transient fish integration

This commit is contained in:
Anthony Rodriguez 2024-12-06 08:55:33 +01:00
parent 09c34d14a3
commit c24ff33ed6
Signed by: nezia
GPG key ID: EE3BE97C040A86CE
2 changed files with 31 additions and 5 deletions

View file

@ -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";

View file

@ -2,5 +2,13 @@
programs.starship = {
enable = true;
enableTransience = true;
settings = {
add_newline = true;
cmd_duration = {
style = "yellow";
format = "[ $duration]($style)";
};
};
};
}