Skip to content

fix(install): auto-rerun mise install when tool list changes#34

Merged
vaintrub merged 1 commit into
masterfrom
fix/mise-config-autoinstall
May 31, 2026
Merged

fix(install): auto-rerun mise install when tool list changes#34
vaintrub merged 1 commit into
masterfrom
fix/mise-config-autoinstall

Conversation

@vaintrub

Copy link
Copy Markdown
Owner

Problem

run_onchange_after_50-install-packages re-fires only when its own content changes. packages.yaml is rendered into the script's DOTFILES_* vars (so edits there re-fire it), but the mise config is read by mise directly — not rendered into the script. So adding/removing a mise tool didn't trigger mise install.

Hit live on the jetson: after merging the direnv PR, chezmoi update applied the new mise config but never ran mise installdirenv declared yet not installed → command not found: direnv.

Fix

Embed the mise config's hash in the script — chezmoi's documented run_onchange dependency idiom:

# mise-config-hash: {{ include "dot_config/mise/config.toml.tmpl" | sha256sum }}

Tool add/remove → raw template changes → hash changes → script content changes → run_onchange re-fires → mise install runs on chezmoi apply. Fires once per edit, then quiet (idempotent).

Demonstrated

Adding a dummy tool flips the rendered hash 92e334…71cc54…; revert restores it. shellcheck clean.

Coverage (all 3 re-fire axes now closed)

  • packages.yaml edits → rendered DOTFILES_* ✓ (existing)
  • profile change → rendered DOTFILES_PROFILE ✓ (existing)
  • mise tool add/remove → embedded hash ✓ (this fix)

Docs (README + mise config header) updated: chezmoi apply now suffices, no manual mise install.

run_onchange_after_50 only re-fired on its own content change — packages.yaml
edits re-fire it (rendered into DOTFILES_* vars), but the mise config is read
by mise directly, so adding/removing a mise tool didn't trigger `mise install`
(hit on the jetson: direnv declared but not installed after chezmoi update).

Embed the mise config's hash in the script (chezmoi's documented run_onchange
dependency idiom: `include | sha256sum`). Now a tool add/remove changes the
script → re-fires → mise install runs on apply. Demonstrated: dummy tool flips
the hash. Docs updated (README + config header): 'chezmoi apply' now suffices.
@vaintrub vaintrub merged commit 48d49a4 into master May 31, 2026
3 checks passed
@vaintrub vaintrub deleted the fix/mise-config-autoinstall branch May 31, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant