From 719968dd98ae1237bfb02451b8b35e06b33e0669 Mon Sep 17 00:00:00 2001 From: hkalbasi Date: Thu, 29 Aug 2024 19:25:53 +0330 Subject: [PATCH] Check if the selected shell is a directory --- modules/environment/login/login-inner.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/environment/login/login-inner.nix b/modules/environment/login/login-inner.nix index cb929ddb..5449c028 100644 --- a/modules/environment/login/login-inner.nix +++ b/modules/environment/login/login-inner.nix @@ -144,6 +144,11 @@ writeText "login-inner" '' usershell="${config.user.shell}" if [ "$#" -gt 0 ]; then # if script is not called from within Nix-on-Droid app exec /usr/bin/env "$@" + elif [ -d "$usershell" ]; then + echo "Cannot execute shell '${config.user.shell}', it is a directory." + echo "Unlike nixos you should point `user.shell` to the exact binary." + echo "Falling back to bash." + exec -l bash elif [ -x "$usershell" ]; then exec -a "-''${usershell##*/}" "$usershell" else