New laptop: the setup

This is my ever-expanding set of notes about setting my dev environment. One of these days I should turn it into a script or something.

Essentials

First, download and install:

XCode Command Line Tools

Optional, useful tool for monitoring CPU, bandwidth, memory, etc.:

iStat Menus

Preferred terminal app: Warp

Warp

Editor

Install VS Code

Install Zed

Unix libraries

Install homebrew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install unix libs:

brew install gpg2 git git-flow tmux imagemagick postgresql@17 redis pgcli direnv zsh ssh-copy-id openssl nmap coreutils automake autoconf libyaml readline libxslt libtool unixodbc fop starship asdf wget curl jq gh eza graphviz flyctl

To stop annoying git warnings:

mkdir -p ~/.git/templates

Typefaces

brew install --cask font-hack-nerd-font
brew install --cask font-monoid-nerd-font
brew install --cask font-fira-code-nerd-font
brew install --cask font-cousine-nerd-font
brew install --cask font-sauce-code-pro-nerd-font

SSH

Generate an SSH key:

ssh-keygen

Install the handy-dandy ssh-copy-id utility:

brew install ssh-copy-id

Github

Github have a great new tool for performing tasks on GitHub from the command line:

brew install gh
gh auth login

You can then use gh to upload your SSH key to Github:

gh ssh-key add ~/.ssh/id_rsa.pub -t "Work Laptop"

ZSH

Install the latest version of ZSH:

brew install zsh

Set this version as the correct version of ZSH:

sudo vim /etc/shells add the following line into the very end of the file /etc/shells:

/usr/local/bin/zsh

or, on M-series Apple Silicon:

/opt/homebrew/bin/zsh

Change default shell:

chsh -s /usr/local/bin/zsh

or, on M-series Apple Silicon:

chsh -s /opt/homebrew/bin/zsh

Now install oh-my-zsh:

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

development directory

Create my local development directory:

mkdir ~/development

Dotfiles

Install my dotfiles:

git clone git@github.com:suranyami/dotfiles.git
cd dotfiles
bundle
./install.rb

Apps

Install SourceTree for enhanced Git visualization:

SourceTree

Don’t use the Mac App Store version of Slack, download it directly: Slack

mise

As per install instructions for mise here

curl https://mise.run | sh

Activate mise in ~/.zshrc:

echo 'eval "$(~/.local/bin/mise activate zsh)"' >> ~/.zshrc

Install unix libs mine requires to build stuff:

brew install coreutils automake autoconf openssl libyaml readline libxslt libtool unixodbc

Install unix libs needed by Elixir and Erlang:

brew install fop wxwidgets

This blog post talks about how to install the above with :observer working, as well as allowing Erlang wxwidgets to work. But that was before when wxmac was used instead of wxwidgets. I include it here for reference only.

Install Erlang and Elixir:

mise install java@openjdk-18
mise install erlang@latest
mise install elixir@latest
mise install python@latest
mise install ruby@latest
mise install nodejs@latest

if you have compilation problems with Erlang, try brew uninstall pcre, install Erlang, then reinstall pcre.

macOS

This is just my personal preference.

Disable the caps-lock key in System Preferences –> Keyboard –> Modifier Keys

Postgres

To make the postgres role:

createuser -s postgres