Commit 7a9525cf88f7

Vincent Demeester <vincent@sbr.pm>
2026-06-10 14:23:10
feat(aomi): add zsh shell setup to bootstrap
CSB uses LDAP so chsh doesn't work. Added bashrc exec into nix zsh and registers the shell in /etc/shells.
1 parent c84d4dd
Changed files (1)
imperative
imperative/aomi/bootstrap.sh
@@ -272,6 +272,26 @@ print_summary() {
 	log_info "╚══════════════════════════════════════════╝"
 }
 
+# --- Phase 8: Shell setup ---
+
+setup_shell() {
+	local zsh_path="$HOME/.local/state/nix/profile/bin/zsh"
+
+	if ! grep -q "$zsh_path" /etc/shells 2>/dev/null; then
+		log_info "Adding nix zsh to /etc/shells..."
+		echo "$zsh_path" | sudo tee -a /etc/shells
+	fi
+
+	# CSB uses LDAP/FreeIPA, chsh won't work — use bashrc exec instead
+	if ! grep -q 'exec.*zsh' ~/.bashrc 2>/dev/null; then
+		log_info "Configuring bash to exec into zsh..."
+		# shellcheck disable=SC2016
+		echo '[ -x "$HOME/.local/state/nix/profile/bin/zsh" ] && exec "$HOME/.local/state/nix/profile/bin/zsh"' >> ~/.bashrc
+	fi
+
+	log_info "Shell configured (zsh via bashrc exec)"
+}
+
 # --- Main ---
 
 main() {
@@ -289,6 +309,7 @@ main() {
 	setup_wireguard
 	install_native_apps
 	setup_home_manager
+	setup_shell
 	print_summary
 }