Repository navigation
feat(hm): expose a headless startup check for the wrapped neovim - #105
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 9 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… ones Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sses Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
myuron
force-pushed
the
feat/startup-check
branch
from
October 17, 2026 05:08
e5980e1 to
1695abd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a derivation that starts the wrapped Neovim headless with the user's config and fails on any startup error. A dotfiles CI can then catch a broken plugin bump with one line:
API
Both entry points share one implementation in
nix/lib/check.nix:lib.mkCheck { env, configDir, ignoreErrors }.env.check:makeEnvgains optionalconfigDirandcheckarguments.env.checkthrows a clear error if it is forced whileconfigDiris null; the throw is lazy.configDirthrough and adds one option,programs.nvimx.check.ignoreErrors.env.wrappedandenv.farmare unchanged (compared with main).configDirform: it must be a path literal or a store path. An absolute string fails at evaluation in pure mode, not inside the sandbox.What the check does
It runs in the sandbox with a copy of
configDirand temporary XDG/HOME directories, using the driverlua/nvimx/startup-check.lua.lazy.load.lazy.setup()fails rather than passing with nothing checked.vim.ui_attachwith ext_messages, keeping only error kinds;vim.notifythat also catches ERROR notifications from plugins that replace it, whether with a function or with a callable table such as nvim-notify. It stores each assigned function wrapped, so the commonlocal orig = vim.notifychaining pattern calls the previous function and never loops. A depth counter records a chained ERROR only once.v:errmsgis not used, becausesilent!sets it.timeout -k 10 120: plain SIGTERM can't stop nvim while it is busy in Lua. Codes 124 and 137 are both reported as a timeout.:qaduring startup can't pass by exiting 0.programs.nvimx.check.ignoreErrors/ignoreErrorstakes plain substrings to allow.NVIMX_CHECK=1is exported so a config can switch such plugins off.ignoreErrorsis the way out.Tests
checks.startup-check:env.check.runnerruns on these broken fixtures, each expected to fail with a specific message: init error, error in a lazy-loaded config, replaced notify, a callable-table notifier like nvim-notify (vim.notify = require("notify")), chained notify + ERROR (reported exactly once, no hang), stale lock, no lazy, early quit;checks.hm-module-startup-check: provesconfigDirandignoreErrorsreachmakeEnvthrough the module.depth == 0guard;lazy.load.The 120 s timeout path itself is not exercised (too slow for CI).
Verification
nix fmt -- --ci,nix flake checknix build .#checks.x86_64-linux.{startup-check,hm-module-startup-check},nix eval .#checks.aarch64-darwin.{startup-check,hm-module-startup-check}.drvPathenv.wrapped/env.farmdrvPaths identical on main and on this branch.Closes #79
🤖 Generated with Claude Code