New Laptop Setup
This is a guide to setting up an XMTP developer environment on your new Macbook.
It is opinionated, and mostly reflects the preferences of Nick Molnar. YMMV.
Shell Environment
Ensure Xcode Command Line tools are installed by running
xcode-select --installDownload and install iTerm 2 or Warp
(optional) Set your old mac to sync iTerm 2 preferences to a folder in
preferences/general/preferences. Copy those preferences to your new mac, and configure to point to the same folder.xcode-select --installInstall Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Install rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shInstall a bunch of dependencies via Homebrew
brew install nvm go python3 doctl hub bufbuild/buf/bufCreate a .zshrc file. I use oh-my-zsh, which requires a separate installation. Here is my .zshrc:
# If you come from bash you might have to change your $PATH.
export PATH="$HOME/bin:/usr/local/bin:$HOME/.cargo/bin:$PATH"
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="robbyrussell"
# # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# # Example format: plugins=(rails git textmate ruby lighthouse)
# # Add wisely, as too many plugins slow down shell startup.
plugins=(
git
z
)
source $ZSH/oh-my-zsh.sh
# Aliases
alias git="/opt/homebrew/bin/hub"
# Homebrew shellenv
eval "$(/opt/homebrew/bin/brew shellenv)"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completionSource your new
.zshrcwithsource ~/.zshrc.Install the node version found in
xmtp/xmtp-js/.nvmrcby runningnvm install $version. Set it as the default by runningnvm alias default $versionYouJustInstalled.Setup an account on Docker Hub and request to be linked to the organization account in Slack (#team-eng).
Install Docker For Mac, and login to your account using
docker login.Create a new SSH key, and add it to your GitHub. Instructions here
Force git to use your new SSH key:
git config --global url."git@github.com:".insteadOf "https://github.com/"