mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 19:46:07 +01:00
Run shell as login shell
So shell rc files (.profile/.bashrc/.zshrc/...) will be loaded
This commit is contained in:
parent
3aa377bf01
commit
31fd02ba4a
1 changed files with 4 additions and 3 deletions
|
|
@ -68,12 +68,13 @@ writeText "login-inner" ''
|
|||
exec /usr/bin/env bash # otherwise it'll be a limited bash that came with Nix
|
||||
''}
|
||||
|
||||
usershell="${config.user.shell}"
|
||||
if [ "$#" -gt 0 ]; then # if script is not called from within nix-on-droid app
|
||||
exec /usr/bin/env "$@"
|
||||
elif [ -x "${config.user.shell}" ]; then
|
||||
exec "${config.user.shell}"
|
||||
elif [ -x "$usershell" ]; then
|
||||
exec -a "-''${usershell##*/}" "$usershell"
|
||||
else
|
||||
echo "Cannot execute shell '${config.user.shell}', falling back to bash"
|
||||
exec /usr/bin/env bash
|
||||
exec -l bash
|
||||
fi
|
||||
''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue