Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/plttn/dotfiles.
Something went wrong. Try again.
Working in this repo #
This is a chezmoi source directory for public dotfiles. Read README.md for the layout. These rules cover what isn't obvious from the files.
The repo is public #
-
Internal names (work hosts, org names, vault and item names, work emails, internal tool names) only go in encrypted files. That includes comments and commit messages.
-
Before any push, search unencrypted tracked files and the unpushed history:
git ls-files | grep -v '\.age$' | xargs grep -niE '<internal terms>' git --no-pager log -p --no-ext-diff origin/main..HEAD -- . ':(exclude)*.age' -
Public keys are fine to commit. Private keys never are.
SSH and GitHub #
- Never add a global
Host github.comrule, and never change which key the agent offers by default. The work identity must stay the default: private Go modules clone from Go's module cache, outside any folder rule, and a different default breaks them. - Per-identity behavior lives in folder-based
Match execrules in the encrypted~/.ssh/config.d/work. Extend those instead. - The dotfiles remote uses SSH. Don't switch it to HTTPS:
ghsupplies the token there, and its active account is the work one. - Check an identity with
ssh -T git@github.comfrom the folder in question.
chezmoi gotchas #
git.autoCommit = true:chezmoi add,forgetand similar commands commit everything pending in the source directory. Commit or ask about pending work first.- chezmoi prompts before overwriting a file that changed since its last write.
The prompt needs a TTY and fails here. Diff the file, keep anything the user
added (copy it into the source first), and only then use
--force. - Files in the repo root (README.md, CLAUDE.md, the Brewfiles) must stay in
.chezmoiignore, or chezmoi deploys them to~. - Work-only targets belong in the
elsebranch of.chezmoiignore. chezmoi editopens an interactive editor and won't work here. For encrypted files:chezmoi decrypt < file.age > tmp, edit, thenchezmoi encrypt < tmp > file.age. Keep the.tmpl.agesuffix for encrypted templates.- Templates use
missingkey=error; a new data key needs a value on every machine (""orfalsewhen it doesn't apply).
Testing changes #
- Render templates for both machine types with scratch configs instead of the
real one: write a config with
is_work = trueand one withfalse, thenchezmoi --config <scratch> execute-template < file.tmplorchezmoi --config <scratch> cat ~/target. chezmoi --config <scratch> managedshows which targets a machine type gets.brew-driftneeds fzf and a TTY. Test it withfish --no-config(so the user's fish config doesn't reorderPATH) and a stand-infzfscript that prints scripted selections.
1Password #
- Each
opcall costs the user a biometric approval. Never runopto explore. Templates that callonepasswordReadcost one approval perchezmoi diff/status/applyon machines that render them. - The age key fetch script runs
op readonly when the key file is missing.
Homebrew #
brew bundle dumpprints the installed set in Brewfile form, with options such astrusted: trueand custom tap URLs. Copy entries from it rather than writing them by hand or withbrew bundle add, which drops options.brew bundle remove --formulafails for formulae that no longer exist, and without--formulait leaves the description comment behind.brew-driftedits the text directly for that reason.