Skip to content
Minimum viable dotfiles
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.emacs.d
.hammerspoon
.nixpkgs
bin
templates
.bash_profile
.bashrc
.gitconfig
.gitignore
.gitmodules
.irbrc
.npmrc
.tmux.conf
LICENSE
README.org
com.googlecode.iterm2.plist
ispell_english

README.org

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
EOF

Clone the dotfiles

mkdir -p ~/Projects
git clone git@github.com:tungd/dotfiles-lean.git ~/Projects/dotfiles

Making 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 ~/.eslintrc

Install apps and utilities

XCode

xcode-select --install

pkgsrc

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-dl

pyenv

git clone https://github.com/pyenv/pyenv.git ~/.pyenv

stack

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
EOF

z.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.sh

System 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 true

Restart the UI Server service to activate the changes

killall SystemUIServer
You can’t perform that action at this time.