-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Labels
Description
Module Name
programs.fish, programs.nushell, ... (non-POSIX compatible shells)
Requested Feature
To non-POSIX compatible shells (programs.fish, programs.nushell, ...), feature a autoSwitchFromShell option to abstract the mandatory programs.bash.initExtra / programs.zsh.initExtra when not using a POSIX compatible shell by default
- Input
- Type:
lib.types.listOf (lib.types.enum [ "bash" "zsh" ]) - Default:
[ "bash" ]
- Type:
An alternative would be to make two autoSwitchFromBash / autoSwitchFromZsh booleans
There is also the programs.ion shell available in home manager, but I am not familiar enough with it
Current Limitations
Currently, not using a POSIX compatible shell by default requires setting programs.bash.initExtra
For instance, using Nushell :
programs = {
nushell.enable = true;
bash = {
enable = true;
initExtra = ''
if [[ $- == *i* ]] && \
[ -z "$BASH_EXECUTION_STRING" ] && \
[ "$TERM" != "dumb" ] && \
[[ ! "$(< /proc/$PPID/comm)" =~ ^nu(shell)?$ ]];
then
if shopt -q login_shell; then
exec ${lib.getExe pkgs.nushell} --login
else
exec ${lib.getExe pkgs.nushell}
fi
fi
'';
};
};Additional Context
Reactions are currently unavailable