Skip to content

revert(nix): drop forced zsh in the devshell - #214

Merged
loss-and-quick merged 1 commit into
mainfrom
fix/nix-devshell-interactive-zsh
Jul 8, 2026
Merged

revert(nix): drop forced zsh in the devshell#214
loss-and-quick merged 1 commit into
mainfrom
fix/nix-devshell-interactive-zsh

Conversation

@loss-and-quick

@loss-and-quick loss-and-quick commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Reverts #208.

Summary

#208 added an unconditional exec zsh to the devshell shellHook. The hook runs
on every entry into the devshell, not just an interactive nix develop, so
the exec also fires for nix develop --command …, direnv, and any scripted
use — it replaces the process before the command runs, so the command
silently never executes: zsh reads EOF and exits 0, a false green.

This broke nix develop --command:

Repro (on current main)

$ nix develop --command bash -c 'echo ran > /tmp/marker'
$ echo $?          # 0
$ cat /tmp/marker  # No such file or directory — the command never ran

Why revert rather than guard it

Forcing a shell switch in a shared devshell is opinionated and surprising even
when correctly gated: it drops developers into a shell they didn't ask for and
sources their ~/.zshrc on nix develop. Picking a shell is a per-developer
choice (direnv, nix develop -c zsh, a personal wrapper), not something the
shared flake — which CI and everyone else consume — should impose. Reverting
removes the whole class of problem instead of papering over it.

Verification

  • nix develop --command … runs the command again (marker created, cargo from devshell)
  • nix fmt nix/toolchain.nix — 0 changes
  • nix build .#kasumi-desktop green (nix-build CI job)

Notes for reviewers

Recommend merging promptly — several CI jobs on main are currently silent no-ops.

@github-actions github-actions Bot added the nix label Jul 7, 2026
@loss-and-quick
loss-and-quick force-pushed the fix/nix-devshell-interactive-zsh branch from 80439a4 to a735813 Compare July 7, 2026 17:33
@loss-and-quick loss-and-quick changed the title fix(nix): only exec zsh in the devshell when interactive revert(nix): drop forced zsh in the devshell Jul 7, 2026
@loss-and-quick
loss-and-quick merged commit 86e3832 into main Jul 8, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant