mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-09 03:56:06 +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
|
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
|
if [ "$#" -gt 0 ]; then # if script is not called from within nix-on-droid app
|
||||||
exec /usr/bin/env "$@"
|
exec /usr/bin/env "$@"
|
||||||
elif [ -x "${config.user.shell}" ]; then
|
elif [ -x "$usershell" ]; then
|
||||||
exec "${config.user.shell}"
|
exec -a "-''${usershell##*/}" "$usershell"
|
||||||
else
|
else
|
||||||
echo "Cannot execute shell '${config.user.shell}', falling back to bash"
|
echo "Cannot execute shell '${config.user.shell}', falling back to bash"
|
||||||
exec /usr/bin/env bash
|
exec -l bash
|
||||||
fi
|
fi
|
||||||
''
|
''
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue