flocon/home/terminal/shell/fish.nix

30 lines
712 B
Nix

{pkgs, ...}: {
programs.fish = {
enable = true;
interactiveShellInit = ''
set fish_greeting # Disable greeting
fish_vi_key_bindings # Enable Vi mode
'';
shellAbbrs = {
cd = "z";
ngc = "sudo nix-collect-garbage -d";
};
plugins = [
{
name = "fzf";
inherit (pkgs.fishPlugins.fzf) src;
}
];
};
programs.bash = {
enable = true;
initExtra = ''
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
then
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
fi
'';
};
}