{ config, pkgs, lib, ... }: { programs.fish = { enable = true; useBabelfish = true; interactiveShellInit = '' set --global fish_greeting "" ''; shellAliases = lib.mkMerge [ { ip6 = "ip -6"; } (lib.mkIf pkgs.stdenv.isLinux { ping6 = "ping -6"; }) ]; promptInit = '' if ! functions --query tide fish_config prompt choose astronaut end ''; }; users = lib.optionalAttrs pkgs.stdenv.isLinux { defaultUserShell = config.programs.fish.package; users.root.shell = "/bin/sh"; }; programs.bash = { interactiveShellInit = '' # check if parent process is not fish && make nested shells work properly if grep -qv fish /proc/$PPID/comm && [[ $SHLVL == [12] ]]; then # set $SHELL for better integration with programs like nix shell, tmux, etc. SHELL=${pkgs.fish}/bin/fish exec fish fi ''; }; }