macOS Setup
Bootstrap
Install my SSH and GPG keys
Fix macOS Sierra ssh-agent issue
cat >> ~/.ssh/config <<EOF
Host *
IdentityFile ~/.ssh/id_rsa
AddKeysToAgent yes
EOFClone the dotfiles
mkdir -p ~/Projects
git clone git@github.com:tungd/dotfiles-lean.git ~/Projects/dotfilesMaking aliases
mkdir -p ~/.local/bin
mkdir -p ~/.local/vendor
ln -s ~/Projects/dotfiles/.bash_profile ~/.bash_profile
ln -s ~/Projects/dotfiles/.bashrc ~/.bashrc
ln -s ~/Projects/dotfiles/.emacs.d ~/.emacs.d
ln -s ~/Projects/dotfiles/.gitconfig ~/.gitconfig
ln -s ~/Projects/dotfiles/.npmrc ~/.npmrc
ln -s ~/Projects/dotfiles/.eslintrc ~/.eslintrcInstall apps and utilities
XCode
xcode-select --installpkgsrc
I don’t use Homebrew, it is too fragile and invasive for my taste. I tried Nix
but it’s not ready for prime time yet. Deal breaker for me is a long standing
issue regarding watchman (https://github.com/NixOS/nixpkgs/issues/14309).
In the mean time, my package manager of choice is pkgsrc. It is simple, pretty
similar to apt and yum, supports package version pining and has all of the
packages that I need. It’s also not updated too frequently like
Homebrew. Installation is a little bit more involved, though.
BOOTSTRAP_TAR="bootstrap-trunk-x86_64-20171103.tar.gz"
BOOTSTRAP_SHA="d7bee3a08e6e07818ff445f042c469333c96ac22"
curl -O https://pkgsrc.joyent.com/packages/Darwin/bootstrap/${BOOTSTRAP_TAR}
echo "${BOOTSTRAP_SHA} ${BOOTSTRAP_TAR}" >check-shasum
shasum -c check-shasum
sudo tar -zxpf ${BOOTSTRAP_TAR} -C /sudo pkgin update
sudo pkgin install ImageMagick aria2 aspell aspell-en curl gettext gnupg gnutls
sudo pkgin install mosh mysql-client nmap nodejs openssl postgresql10-client
sudo pkgin install socat sqlite3 the_silver_searcher tree watchman wget youtube-dlpyenv
git clone https://github.com/pyenv/pyenv.git ~/.pyenvstack
curl -sSL https://get.haskellstack.org/ | sh -s - -d ~/.local/bin/cat > ~/.stack/config.yaml <<EOF
templates:
params:
author-name: Tung Dao
author-email: me@tungdao.com
copyright: (c) 2019 Tung Dao
github-username: tungd
EOFz.sh
z.sh (https://github.com/rupa/z) allows me to visit one of the directories I
worked on recently by typing just a partial path of it.
curl -L https://raw.githubusercontent.com/rupa/z/master/z.sh > ~/.local/vendor/z.shSystem configuration
Keyboard configuration
Decrease repeat delay, increase repeat rate and disable Emoji.
defaults write -g ApplePressAndHoldEnabled -bool false
defaults write -g InitialKeyRepeat -int 10
defaults write -g KeyRepeat -int 1
defaults write -g NSUserKeyEquivalents -dict-add 'Emoji & Symbols' '@^j'No shadow on window capture (Cmd-S-4 SPC)
defaults write com.apple.screencapture disable-shadow -bool trueRestart the UI Server service to activate the changes
killall SystemUIServer