These instructions are to be followed when installing these dotfiles on a new machine. Do these steps:
-
XCode: If running on a Mac, you need part of XCode. You don't need the whole XCode. Open the terminal and run
xcode-select --install
which will prompt the installer.
-
Homebrew: install it following the website's instructions, then export its path for now:
export PATH="/opt/homebrew/bin:$PATH"
-
Git: ensure you have
git
installed (it's present by default on macOS). -
zsh: install zsh with
$ brew install zsh
, then add the newly-installedzsh
to/etc/shells
(so thatchsh
will consider it a "safe" shell) and change to the newly added shell:echo "$(which zsh)" | sudo tee -a /etc/shells > /dev/null chsh -s "$(which zsh)" "$(whoami)"
Now do these:
-
delete
/etc/zprofile
-
remove
path_helper
-related lines from/etc/profile
-
make sure
/etc/paths
contains this:/usr/bin /bin /usr/sbin /sbin
These slow things down and mess up with
$PATH
. -
-
Ensure you have the
$DOTFILES
environment variable set. For example:export DOTFILES="$HOME/dotfiles"
-
Copy SSH keys from 1Password (after doing
mkdir ~/.ssh
), into~/.ssh/id_rsa
and~/.ssh/id_rsa.pub
. -
Clone the dotfiles and run the setup script:
git clone git@github.com:whatyouhide/dotfiles.git "$DOTFILES" cd "$DOTFILES" ./setup
-
Authenticate to GitHub by doing:
gh auth login
GitHub takes care of the whole flow for you, by redirecting you to a browser to do the authentication.
-
Set up GPG signing of commits (mostly following this guide).
-
Add the
signinkey
andgpgsign
configs to~/.gitconfig
(thesigninkey
is in 1Password). Then, add this line to~/.zshenv-extra
:export GPG_TTY=$(tty)
-
Export the public and private GPG keys from the previous machine:
gpg --list-secret-keys # Get the ID like this gpg --export <ID> > public.key gpg --export-secret-key <ID> private.key
-
Move these files on the new machine and run:
gpg --import public.key gpg --import private.key
Make sure that
gpg --list-secret-keys
shows the key. -
Set up macOS GPG signing with pinentry.
brew install pinentry-mac echo "pinentry-program $(which pinentry-mac)" >> ~/.gnupg/gpg-agent.conf killall gpg-agent
-
-
asdf: you're using asdf installed via Homebrew. Add this to
~/.zshenv-extra
:echo "\nsource $(brew --prefix asdf)/libexec/asdf.sh" >> ~/.zshenv.extra