all repos — nixfiles @ d4c781b94282350c639e64575629f94624205987

System and user configuration, managed by nix and home-manager

shell: replace shell with fish if likely normal login

Alin
commit

d4c781b94282350c639e64575629f94624205987

parent

26504b6fb53fb2cff1e2d3a4690d447b70320c90

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 + ''; + }; }