shell: replace shell with fish if likely normal login
1 file changed, 10 insertions(+), 0 deletions(-)
changed files
M system/settings/programs/shell.nix → system/settings/programs/shell.nix
@@ -29,4 +29,14 @@ 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 + ''; + }; }