Pin plugin archives and stop dfu auto-refresh#15
Merged
Conversation
Replace floating git-repo externals with commit + SHA-256 pinned archives under ~/.local/share so they do not conflict with the ~/.vim and ~/.zsh symlinks. Point vim packpath and zsh plugin sources at the new locations. Make dfu apply with --refresh-externals=never (and fail on apply errors); add dfup for explicit re-download of the pinned archives after bumping pins in .chezmoiexternal.toml. Co-authored-by: Huy Pham <hdp617@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens plugin supply-chain handling by moving Vim/Zsh third-party plugins from floating git-repo externals to commit-pinned GitHub archive downloads verified by SHA-256, and by changing the default dotfiles update flow (dfu) to avoid auto-refreshing externals.
Changes:
- Convert Vim/Zsh plugin externals in
.chezmoiexternal.tomlto commit-pinnedarchiveURLs withchecksum.sha256, installed under~/.local/share/.... - Update Vim/Zsh config to load plugins from the new
~/.local/sharelocations (Vimpackpath, Zshfpathandsourcepaths). - Update dotfiles update helpers and docs:
dfuno longer refreshes externals; adddfupto explicitly refresh pinned archives.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
zsh/plugins_before.zsh |
Point zsh-completions fpath at the new pinned archive location under ~/.local/share. |
zsh/plugins_after.zsh |
Source zsh-syntax-highlighting from the new pinned archive location under ~/.local/share. |
shell/aliases.sh |
Make dfu stop refreshing externals by default and fail on apply error; add dfup for explicit refresh. |
README.md |
Document the new pinned-archive approach, new install locations, and updated dfu/dfup behavior. |
dot_vimrc |
Prepend ~/.local/share/vim to packpath so Vim finds pinned pack plugins outside ~/.vim. |
dot_config/fish/functions/dfup.fish |
Add Fish dfup helper to force refresh of pinned externals. |
dot_config/fish/functions/dfu.fish |
Update Fish dfu to avoid external refresh by default and to fail on apply error. |
.gitignore |
Narrow ignore rules to leftover historical plugin clone paths (vim/pack, specific zsh plugin clone dirs). |
.chezmoiexternal.toml |
Switch externals to archive + pinned commit tarballs + SHA-256 checksums under ~/.local/share. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Fixes review item #3: floating
git-repoexternals plusdfualways using--refresh-externals=alwaysmeant the next update could silently pull compromised vim/zsh plugin tips into the shell/editor.Changes
.chezmoiexternal.tomlto commit-pinnedarchiveURLs withchecksum.sha256~/.local/share/vimand~/.local/share/zsh/plugins(archive externals conflict withsymlink_dot_vim/symlink_dot_zshif placed under~/.vim/~/.zsh)packpathand zsh plugin source/fpathat those pathsdfu:--refresh-externals=never, fail ifapplyfailsdfup: explicit refresh of the pinned archives after bumping commits/checksums.gitignoreupdated for the new layoutMigration
After apply, you can remove leftover clones from the old layout:
~/.vim/pack~/.zsh/plugins/zsh-completions~/.zsh/plugins/zsh-syntax-highlightingBumping a plugin later
checksum.sha256in.chezmoiexternal.tomldfup(orchezmoi apply --refresh-externals=always)Test plan
chezmoi apply -Rinstalled all six vim packs + both zsh plugins into a test destSHA256 mismatchchezmoi apply, confirm plugins load;dfudoes not float upstream