nix-configs/modules/cli/fish.nix

33 lines
866 B
Nix

{
pkgs,
config,
lib,
...
}:
let
cfg = config.xyno.cli.fish;
in
{
options.xyno.cli.fish.enable = lib.mkEnableOption "enable the fish shell with xynos config";
config = lib.mkIf cfg.enable {
programs.bash = {
# auto spawn fish if interactive
interactiveShellInit = ''
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
'';
};
environment.systemPackages = with pkgs; [
fishPlugins.grc
grc
];
programs.direnv.enableFishIntegration = true;
programs.fish.interactiveShellInit = ''
set -g fish_key_bindings fish_vi_key_bindings
'';
programs.fish.enable = true;
};
}