My dotfiles for macOS and zsh. chezmoi manages them.
On a new Mac:< 7CE9 /p>
sh -c "$(curl -fsLS get.chezmoi.io)" -- init --apply stigi/.dotschezmoi asks for the git author name and email, and if the Mac is a Pitch work machine. Then it does these steps:
- It installs Homebrew and the packages that the dotfiles use.
- It writes the files into the home directory.
- It installs the vim plugins.
Secretive keeps the SSH keys in the Secure Enclave. chezmoi installs it. ~/.zshenv sets SSH_AUTH_SOCK to the Secretive agent, thus ssh and git signatures use it.
A key cannot leave the Mac on which you made it. On a new Mac, do these steps:
-
Open Secretive and let it install its agent.
-
Make the keys. The configs use these key names:
Key name Use githubLogin to GitHub. github-signingSigns commits and tags. Give ~/.ssh/secretive/github-signing.pubas the signing key when chezmoi asks.git.ullrich.isLogin to the Forgejo server. git.ullrich.is-signingSigns commits and tags in repositories with a git.ullrich.isremote.A Pitch work machine also needs a key with the name
pitch-signing, and a key with the comment<work email> - Githubfor the GitHub account for work. -
Run
script/link-secretive-keys.sh. It links each public key to~/.ssh/secretive/<key name>.pub. If a key has a custom comment in Secretive, the link gets the comment as its name. -
Add the public keys to the hosts, to GitHub and to Forgejo. Add each signing key as a signing key.
-
Run
chezmoi apply. It writes~/.gitconfig-git.ullrich.isonly if the link forgit.ullrich.is-signingexists.
~/.ssh/config is not in this repository. For a host that uses a Secretive key, it has these lines:
IdentityAgent "~/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh"
IdentityFile ~/.ssh/secretive/<key name>.pub
IdentitiesOnly yes
| Path | Content |
|---|---|
home/ |
The chezmoi source state. .chezmoiroot points to this folder. |
home/dot_config/exact_zsh/ |
The zsh components. ~/.zshrc loads them from ~/.config/zsh. |
home/.chezmoiignore |
The files that only a Pitch work machine gets. |
script/install-android.sh |
Optional Android setup. Run it manually. |
script/link-secretive-keys.sh |
Links the Secretive public keys into ~/.ssh/secretive. Run it manually. |
The zsh components load in three steps:
<topic>.env.zsh: exports andPATHchanges.homebrew.env.zshloads first.- All other
*.zshfiles. <topic>.completion.zsh: these load aftercompinit.
chezmoi edit ~/.zshrc # edit the source file
chezmoi diff # show what an apply changes
chezmoi apply # write the changes into the home directory
chezmoi cd # open a shell in the source repositoryThe first version was based on holman/dotfiles and robb/.dotfiles. Thanks!