If you are not familiar with what dotfiles are, you can read this article about them.
My dotfiles setup is heavily inspired by Dries Vints' Getting Started with Dotfiles.
- yadm to manage the installation of these dotfiles into my local machine.
- Zinit to manage the Zsh plugins.
I have been using dotfiles for quite some time, but the setup was not ideal because back then I was a newbie in the UNIX ecosystem. Here are the things that I resent from my previous setup:
- Slow performance. See the Zsh benchmark before improvements below.
- Exposed secrets. I was a newbie, so I didn't have a clear idea about what should be hidden from the user of my dotfiles. Even if I knew, I didn't know how I could hide them properly. That's the reason I'm unable to make my old dotfiles repository public.
- Limited coverage. It didn't cover things that I still had to do manually, such as installing apps.
-
Install yadm using Homebrew and clone this repository.
$ brew install yadm ==> Downloading https://github.com/TheLocehiliosan/yadm/archive/3.1.0.tar.gz ==> Downloading from https://codeload.github.com/TheLocehiliosan/yadm/tar.gz/3.1.0 ==> make install PREFIX=/usr/local/Cellar/yadm/3.1.0 ==> Caveats zsh completions have been installed to: /usr/local/share/zsh/site-functions ==> Summary 🍺 /usr/local/Cellar/yadm/3.1.0: 21 files, 194.7KB, built in 6 seconds $ yadm clone git@github.com:zainfathoni/dotfiles.git Cloning into 'repo.git'... remote: Enumerating objects: 527, done. remote: Counting objects: 100% (527/527), done. remote: Compressing objects: 100% (326/326), done. remote: Total 527 (delta 292), reused 388 (delta 163), pack-reused 0 Receiving objects: 100% (527/527), 1.32 MiB | 1.21 MiB/s, done. Resolving deltas: 100% (292/292), done. **NOTE** Local files with content that differs from the ones just cloned were found in /Users/zain. They have been left unmodified. Please review and resolve any differences appropriately. If you know what you're doing, and want to overwrite the tracked files, consider 'yadm checkout "/Users/zain"'. Found /Users/zain/.config/yadm/bootstrap It appears that a bootstrap program exists. Would you like to execute it now? (y/n) y ...
-
Run
yadm bootstrap
if it's not run automatically.$ yadm bootstrap
-
Compare your files that are managed by yadm and update them accordingly.
$ yadm status On branch main Your branch is up to date with 'origin/main'. Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) typechange: .hushlogin typechange: .ssh/config typechange: .zshrc no changes added to commit (use "git add" and/or "git commit -a") $ yadm checkout HEAD -- .hushlogin .ssh/config .zshrc $ yadm status On branch main Your branch is up to date with 'origin/main'. nothing to commit, working tree clean
-
Import your GPG secret & public keys into GPG Suite. GPG Suite app should have been installed by the
yadm bootstrap
command above. You can import the keys by copying them from wherever you're storing them and pasting them to the GPG Keychain app. -
Decrypt encrypted files
$ yadm decrypt
mackup backup
mackup restore
- When installing a new app, tool or font, try to install it with Homebrew and add it to the
Brewfile
- When configuring a new app make sure to run
mackup backup
to save the preferences - When changing a macOS setting, try setting it through the
macos
file - Always save documents through a cloud storage like iCloud, Dropbox, or something else