Personal Machine
A complete example of a personal machine kit. Based on the dotkit-run/example repo.
Repo layout
Section titled “Repo layout”Directorydotkit/
- .dotkit
- dotkit.env
Directoryconfigs/
- dock.sh
Directorytools/
- community.txt
Directorypackages/
- brew.md
- mas.txt
Directorygit/
- git.env
- config.txt
- repos.txt
Directorypostconfigs/
- dock.sh
Directorydotfiles/
- .zshrc
- .gitignore_global
Directorytodo/
- setup.md
.dotkit
Section titled “.dotkit”The entry point. It names every folder and the order they run in:
map dotkit run {{item}}
configstoolspackagesgitpostconfigs---dotkit link dotfilesdotkit todo -f --title 'Setup Checklist' --out ~/TODO.md todoNothing else marks a folder. dotfiles/ is a symlink source because this file says so, and todo/ is a checklist for the same reason.
A bare .dotkit is named after its directory and runs without prompting.
Run it with:
dotkit run ~/dotkitdotkit.env
Section titled “dotkit.env”Variables available to everything in the kit:
DOTKIT_DEV_DIR="~/dev"configs/
Section titled “configs/”Shell scripts run first, before any tools are installed. No package manager required.
defaults write com.apple.dock autohide -bool truedefaults write com.apple.dock tilesize -int 48killall Docktools/
Section titled “tools/”Install package managers and toolchains. Uses community modules:
map dotkit run :tools/{{item}}
brewnode-fnmrustuvpackages/
Section titled “packages/”With tools in place, install everything else.
brew.md - Homebrew taps, formulae, and casks:
# Homebrew
## map
- brew tap **1**- hashicorp/tap
## map
- brew install **1**- gh- ripgrep- dockutil
## map
- brew install --cask **1**- firefox- visual-studio-code- ghosttymas.txt - Mac App Store apps (macOS only):
try command -v masbrew install masecho 'Sign in to the App Store manually first'---map mas install {{key}}# Development497799835 = Xcode# Communication310633997 = WhatsAppGit global config and repo clones. git.env provides a folder-scoped variable, read only for files in this folder:
MY_DEV_DIR=$DOTKIT_DEV_DIRAny *.env name works. For a variable used by one file only, skip the file and set it in a block instead.
config.txt - set global git options:
git config --global core.excludesfile ~/.gitignore_global---map git config --global {{key}} {{value}}#user.name = Your Name#user.email = [email protected]#init.defaultBranch = mainrepos.txt - clone your repos:
map git clone [email protected]:{{1}}/{{2}}.git $MY_DEV_DIR/{{3}}#yourname = dotkit = dotkit#yourname = dotfiles = dotfilesdotfiles/
Section titled “dotfiles/”dotkit link dotfiles symlinks every file here to the matching path under ~:
dotfiles/.zshrc → ~/.zshrcdotfiles/.gitignore_global → ~/.gitignore_globalThe destination defaults to ~. Pass a second argument for anywhere else.
dotkit todo generates a checklist of steps that can’t be automated. Title and output path are arguments in the dotkit file, so the folder needs no configuration of its own.
- [ ] Sign in to the App Store- [ ] Configure VPN- [ ] Set up Password ManagerDay-to-day
Section titled “Day-to-day”Re-apply symlinks after adding a dotfile:
dotkit link dotfilesPreview a run without changing anything:
dotkit run --dry-run ~/dotkitInstall a new package and track it:
dotkit add packages/brew neovimThis adds neovim to the map block in brew.md and installs it immediately. It finds the kit by walking up from your working directory, so run it from inside the repo.