From 7d730c2ca7dafb24f76b48aa6a8185fc544886f8 Mon Sep 17 00:00:00 2001 From: Vincent Verbruggen Date: Thu, 27 Nov 2025 10:50:52 +0100 Subject: [PATCH] vault backup: 2025-11-27 10:50:52 --- Career/Resources/Dotfiles Management.md | 68 +++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Career/Resources/Dotfiles Management.md diff --git a/Career/Resources/Dotfiles Management.md b/Career/Resources/Dotfiles Management.md new file mode 100644 index 0000000..7479db2 --- /dev/null +++ b/Career/Resources/Dotfiles Management.md @@ -0,0 +1,68 @@ +# Dotfiles Management + +## Decision: YADM + +Chosen for cross-platform dotfile management (macOS, Linux, Windows via WSL). + +## Why YADM over alternatives + +| Approach | Verdict | +|----------|---------| +| Git bare repo | No tooling for OS-specific configs | +| GNU Stow | No Windows support, symlinks can confuse tools | +| Chezmoi | Requires source dir + apply step, easy to forget | +| **YADM** | Files in place, just git, alternate files per OS | + +### Key factors +- Works on Windows through WSL (native Windows not needed) +- Files stay in place, no copy/apply step +- Closest to "two-way sync" - just edit and commit +- Alternate files via naming convention: `.zshrc##os.Darwin`, `.zshrc##os.Linux` + +## Setup + +```bash +# Install +brew install yadm # macOS +sudo pacman -S yadm # Arch +# Windows: use through WSL + +# Init new repo +yadm init +yadm remote add origin git@github.com:user/dotfiles.git + +# Or clone existing +yadm clone git@github.com:user/dotfiles.git +``` + +## Workflow + +```bash +# Edit files normally +vim ~/.zshrc + +# Commit when ready +yadm add -u && yadm commit -m "updates" && yadm push + +# Quick sync alias +alias yadm-sync='yadm add -u && yadm commit -m "sync $(date +%Y-%m-%d)" && yadm push' +``` + +## OS-Specific Files + +Use alternate files with `##` suffix: + +``` +~/.zshrc##os.Darwin # macOS +~/.zshrc##os.Linux # Linux +~/.zshrc##default # Fallback +``` + +YADM automatically uses the right one based on OS. + +## Links + +- https://yadm.io/ +- https://github.com/yadm-dev/yadm + +#dotfiles #yadm #git #linux #macos #configuration