dot system: chsh to the distro zsh, never the Nix profile's
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013UzjWUxheYfqqjWGH7Ktmc
This commit is contained in:
1 parent
ccfd442386
commit
31ba5abca4
1 file changed
+3
-1
@@ -153,7 +153,9 @@ cmd_system() {
|
||||
browser_policies
|
||||
fi
|
||||
[ $netbird = 1 ] && netbird_service
|
||||
local zsh_path; zsh_path="$(command -v zsh || true)"
|
||||
# Prefer the distro's zsh: a login shell inside the Nix profile dies with the profile.
|
||||
local zsh_path=""
|
||||
for z in /usr/bin/zsh /bin/zsh; do [ -x "$z" ] && { zsh_path="$z"; break; }; done
|
||||
if [ -n "$zsh_path" ] && [ "$(getent passwd "$USER" | cut -d: -f7)" != "$zsh_path" ]; then
|
||||
grep -qx "$zsh_path" /etc/shells || echo "$zsh_path" | SUDO tee -a /etc/shells >/dev/null
|
||||
SUDO chsh -s "$zsh_path" "$USER" && ok "login shell → $zsh_path" || warn "chsh failed; bash will hand off to zsh instead"
|
||||
|
||||
Reference in new issue
Block a user