From 44b56d6fcf5ce4031e6602ad0c2a9479d2af6580 Mon Sep 17 00:00:00 2001 From: TheGeneralist <180094941+thegeneralist01@users.noreply.github.com> Date: Mon, 16 Mar 2026 17:16:35 +0100 Subject: [PATCH] fix macOS local terminals not exec-ing nu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The SSH_TTY guard was too broad — it broke local terminal sessions on macOS. Use platform-specific conditions: Darwin omits the SSH_TTY check (always exec nu unless IDE/skip), Linux keeps it (only exec nu for interactive SSH, leaving non-interactive sessions like Codex in zsh). Co-Authored-By: Claude Sonnet 4.6 --- modules/common/shell/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/common/shell/default.nix b/modules/common/shell/default.nix index bc4b6d2..a6f4a5e 100644 --- a/modules/common/shell/default.nix +++ b/modules/common/shell/default.nix @@ -67,6 +67,11 @@ in homeArgs: let config' = homeArgs.config; + nuExecCondition = + if config.isDarwin then + ''[ -z "$INTELLIJ_ENVIRONMENT_READER" ] && [ -z "$skip" ]'' + else + ''[ -z "$INTELLIJ_ENVIRONMENT_READER" ] && [ -z "$skip" ] && [ -n "$SSH_TTY" ]''; in { home.file.".zshrc".text = # zsh @@ -74,7 +79,7 @@ in export PATH="$HOME/.local/bin:/run/current-system/sw/bin:/nix/var/nix/profiles/default/bin:/etc/profiles/per-user/$USER/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin''${PATH:+:}''${PATH}" source ${config'.home.sessionVariablesPackage}/etc/profile.d/hm-session-vars.sh - if [ -z "$INTELLIJ_ENVIRONMENT_READER" ] && [ -z "$skip" ] && [ -n "$SSH_TTY" ]; then + if ${nuExecCondition}; then SHELL='${lib.getExe <| lib.head config'.shellsByPriority}' exec "$SHELL" fi '';