feat: installer boots nvim once and restores the lazy-lock pins

A first nvim start cloned the later-round plugins (claudecode, mini.*,
nvim-lint, friendly-snippets, ...) at branch tip and rewrote the seeded
lazy-lock.json with the tips. The install pipeline now ends with a headless
first boot, puts the seeded lockfile back, and runs `Lazy! restore`. It runs
only where lazy has never installed a plugin, so a lockfile the user has
moved on is never touched, and a second run does nothing.
This commit is contained in:
bcherb2 committed 2026-11-18 02:29:35 -05:00
1 parent 4e2452e994
commit e0c78a3ffa
5 files changed
+121

No files matched your search

+16
View File
@@ -157,6 +157,22 @@ herdr)
integration:install) [ "$mode" = install ] && exit 1 ;;
esac
exit 0 ;;
nvim)
# Behaves like lazy.nvim's first start: a plain boot creates the plugin
# directory and REWRITES lazy-lock.json with drifted commits, which is the
# bug the installer's first-boot step exists to undo. `+Lazy! restore`
# records the lockfile it was handed in ~/.nvim-restored-from. Injections:
# FAKE_FAIL=nvim:boot and FAKE_FAIL=nvim:restore.
_lock=${XDG_CONFIG_HOME:-$HOME/.config}/nvim/lazy-lock.json
case "$*" in
*'Lazy! restore'*)
[ "$mode" = restore ] && exit 1
cp "$_lock" "$HOME/.nvim-restored-from"; exit 0 ;;
esac
mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}/nvim/lazy/lazy.nvim"
[ -f "$_lock" ] && printf '{ "drifted": "tip" }\n' > "$_lock"
[ "$mode" = boot ] && exit 1
exit 0 ;;
fzf)
# The picker's own fzf, and the only fake here whose ARGV is the thing
# under test. `--bind` strings are built across a dozen continued lines, so