Skip to content

cdwilson/dotfiles

Repository files navigation

🏠 dotfiles

REUSE status

My dotfiles in $HOME automatically managed by chezmoi.

💻 System Setup

🍎 macOS Setup

Command Line Tools for Xcode Setup

Once you have Xcode installed, open a terminal and run the following to install the required command line developer tools:

xcode-select --install

Homebrew Setup

Homebrew is a package manager for macOS that can be used to install packages that aren't included by Apple.

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

Git Setup

Install the latest version of Git from Homebrew:

brew install git gpg

1Password Setup

Install 1Password password manager from Homebrew:

brew install --cask 1password

After installing, go to "Settings…" → "Developer" → "Set Up SSH Agent…" and make sure the SSH agent and CLI are enabled:

1password_developer_settings_mac

1Password CLI Setup

With 1Password CLI, you can automate administrative tasks and load secrets straight from your command line and in your scripts.

brew install --cask 1password/tap/1password-cli

Bash Setup

The older bash 3.2 provided by Apple with macOS is not compatible with modern bash completion (e.g. homebrew's bash-completion@2 requires bash 4.2+ and Click requires bash 4.4+). Instead, use a more recent bash + bash completion from home-brew.

brew install bash bash-completion@2

In addition, optionally install the bash language server to enable editor extensions like Bash IDE for VSCode.

# Optional
brew install bash-language-server

Terminal.app Setup

On macOS, if you're using a custom shell installed via Homebrew or MacPorts, remember to configure the shell in your terminal preferences.

  1. Change the Command preference to the full path of your shell:

    macos_terminal_shell_command

  2. Add your shell to /etc/shells:

    # List of acceptable shells for chpass(1).
    # Ftpd will not allow users to connect who are not using
    # one of these shells.
    
    /bin/bash
    /bin/csh
    /bin/dash
    /bin/ksh
    /bin/sh
    /bin/tcsh
    /bin/zsh
    /opt/homebrew/bin/bash <-- Add your shell here
    
  3. To use the Terminal.app profile, just double click the macOS/terminal/cdwilson.terminal file in Finder.

dotfiles Setup

Install the dotfiles from this repository using chezmoi (make sure to change cdwilson to your GitHub username!):

sh -c "$(curl -fsLS git.io/chezmoi)" -- init --apply cdwilson

Starship Setup

Starship is the minimal, blazing-fast, and infinitely customizable prompt for any shell!

  1. Install starship:

    # via Homebrew for Mac
    brew install starship
  2. To get started configuring starship, add your changes to ~/.config/starship.toml

Font Setup

To install the Monaspace font used in my iTerm2 profile below, make sure to install the patched "Monaspice" version from Nerd Fonts (Starship uses many of the icons in Nerd Fonts version):

# via Homebrew for Mac
brew tap homebrew/cask-fonts

# Monaspace Nerd Font
brew install --cask font-monaspace-nerd-font

iTerm2 Setup

iTerm2 is a replacement for Terminal and the successor to iTerm.

  1. Install iTerm2 via Homebrew:

    brew install --cask iterm2
  2. Install the Tomorrow Night color profile from [macOS/iTerm2/color_presets/Tomorrow Night.itermcolors](macOS/iTerm2/color_presets/Tomorrow Night.itermcolors):

    iterm2_colors_tomorrow_night

  3. Install Homebrew Bash (ARM) profile from [macOS/iTerm2/profiles/Homebrew Bash (ARM).json](macOS/iTerm2/profiles/Homebrew Bash (ARM).json):

    iterm2_profile_homebrew_bash_arm

pipx Setup

pipx lets you easily install and run Python applications in isolated environments.

brew install pipx

direnv Setup

direnv lets you easily load and unload environment variables depending on the current directory.

brew install direnv

rbenv Setup

rbenv is a version manager that lets you easily install and switch between multiple versions of Ruby.

  1. Install dependencies for building Ruby:

    brew install openssl readline
  2. Install rbenv using the Basic GitHub Checkout instructions (I'm not using rbenv-installer because I don't want rbenv installed via Homebrew on macOS):

    git clone https://github.com/rbenv/rbenv.git ~/.rbenv
  3. Optionally, try to compile dynamic bash extension to speed up rbenv. Don't worry if it fails; rbenv will still work normally:

    cd ~/.rbenv && src/configure && make -C src
    
  4. Install ruby-build plugin that lets you easily install Ruby versions:

    mkdir -p "$(rbenv root)"/plugins
    git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
  5. Verify the state of your rbenv installation:

    curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-doctor | bash

pyenv Setup

pyenv is a rbenv-style version manager that lets you easily install and switch between multiple versions of Python.

  1. Install dependencies for building Python:

    brew install openssl readline sqlite3 xz zlib
  2. Install pyenv using pyenv-installer:

    curl https://pyenv.run | bash
  3. Optionally, try to compile a dynamic Bash extension to speed up Pyenv. Don't worry if it fails; Pyenv will still work normally:

    cd ~/.pyenv && src/configure && make -C src
    
  4. Verify the state of your pyenv installation:

    pyenv doctor

pls Setup

pls is a prettier and more powerful alternative to ls(1) written in Rust.

brew install pls-rs/pls/pls

To get started configuring pls, add your changes to ~/.pls.yml


🐧 Ubuntu Linux Setup

apt Setup

Update package information from the package repository and install dependencies:

sudo apt update
sudo apt upgrade
sudo apt install curl
sudo locale-gen en_US.UTF-8

# Optional: install a GUI desktop on a server image
sudo apt install ubuntu-desktop
sudo apt install gnome-software

Git Setup

Install the latest version of Git from the package repository:

sudo apt install git gpg

1Password Setup

1Password Setup for amd64
curl -sS https://downloads.1password.com/linux/keys/1password.asc | sudo gpg --dearmor --output /usr/share/keyrings/1password-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/$(dpkg --print-architecture) stable main" | sudo tee /etc/apt/sources.list.d/1password.list
sudo mkdir -p /etc/debsig/policies/AC2D62742012EA22/
curl -sS https://downloads.1password.com/linux/debian/debsig/1password.pol | sudo tee /etc/debsig/policies/AC2D62742012EA22/1password.pol
sudo mkdir -p /usr/share/debsig/keyrings/AC2D62742012EA22
curl -sS https://downloads.1password.com/linux/keys/1password.asc | sudo gpg --dearmor --output /usr/share/debsig/keyrings/AC2D62742012EA22/debsig.gpg
sudo apt update && sudo apt install 1password
1Password Setup for arm64
cd ~/Downloads
curl -sSO https://downloads.1password.com/linux/tar/stable/aarch64/1password-latest.tar.gz
tar -xf 1password-latest.tar.gz
sudo mkdir -p /opt/1Password
sudo mv 1password-*/* /opt/1Password
sudo /opt/1Password/after-install.sh
cd ~
mkdir ~/.ssh
chmod 700 ~/.ssh
touch ~/.ssh/config
cd /usr/share/applications/
sudo ln -s /opt/1Password/resources/1password.desktop 1password.desktop
cd /usr/share/icons/hicolor/256x256/apps/
sudo ln -s /opt/1Password/resources/icons/hicolor/256x256/apps/1password.png 1password.png
cd /usr/share/icons/hicolor/32x32/apps/
sudo ln -s /opt/1Password/resources/icons/hicolor/32x32/apps/1password.png 1password.png
cd /usr/share/icons/hicolor/512x512/apps/
sudo ln -s /opt/1Password/resources/icons/hicolor/512x512/apps/1password.png 1password.png
cd /usr/share/icons/hicolor/64x64/apps/
sudo ln -s /opt/1Password/resources/icons/hicolor/64x64/apps/1password.png 1password.png
sudo gtk-update-icon-cache /usr/share/icons/hicolor

After installing, go to "Settings…" → "Developer" → "Set Up SSH Agent…" and make sure the SSH agent and CLI are enabled:

1password_developer_settings_ubuntu

1Password CLI Setup

With 1Password CLI, you can automate administrative tasks and load secrets straight from your command line and in your scripts.

curl -sS https://downloads.1password.com/linux/keys/1password.asc | sudo gpg --dearmor --output /usr/share/keyrings/1password-archive-keyring.gpg

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/$(dpkg --print-architecture) stable main" | sudo tee /etc/apt/sources.list.d/1password.list

sudo mkdir -p /etc/debsig/policies/AC2D62742012EA22/
curl -sS https://downloads.1password.com/linux/debian/debsig/1password.pol | sudo tee /etc/debsig/policies/AC2D62742012EA22/1password.pol
sudo mkdir -p /usr/share/debsig/keyrings/AC2D62742012EA22
curl -sS https://downloads.1password.com/linux/keys/1password.asc | sudo gpg --dearmor --output /usr/share/debsig/keyrings/AC2D62742012EA22/debsig.gpg

sudo apt update && sudo apt install 1password-cli

op --version

dotfiles Setup

Install the dotfiles from this repository using chezmoi (make sure to change cdwilson to your GitHub username!):

sh -c "$(curl -fsLS git.io/chezmoi)" -- init --apply cdwilson

GNOME Terminal Setup

  1. To use the prompt shown in the photo above, install https://starship.rs/:

    curl -sS https://starship.rs/install.sh | sh
  2. To get started configuring starship, add your changes to ~/.config/starship.toml

  3. To use the GNOME Terminal profile colors shown in the photo above, install https://github.com/aarowill/base16-gnome-terminal:

    sudo apt install gconf2 uuid-runtime
    git clone https://github.com/aaron-williamson/base16-gnome-terminal.git ~/.config/base16-gnome-terminal
    # a new profile needs to be created in the terminal preferences UI before running the next command, otherwise it will appear to do nothing (it can be deleted afterwards)
    ~/.config/base16-gnome-terminal/color-scripts/base16-tomorrow-night.sh
  4. To use the Monaspace font, make sure to install the patched "Monaspice" version from Nerd Fonts (Starship uses many of the icons in Nerd Fonts version):

    cd ~/Downloads
    wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.0/Monaspace.zip
    mkdir -p ~/.local/share/fonts
    unzip Monaspace.zip -d ~/.local/share/fonts/
    fc-cache -fv

    ubuntu_custom_font

  5. Make sure the "Run command as a login shell" is checked to ensure that .bash_profile is sourced:

    ubuntu_terminal_login_shell

pipx Setup

pipx lets you easily install and run Python applications in isolated environments.

sudo apt install pipx

direnv Setup

direnv lets you easily load and unload environment variables depending on the current directory.

sudo apt install direnv

rbenv Setup

rbenv is a version manager that lets you easily install and switch between multiple versions of Ruby.

  1. Install dependencies for building Ruby:

    # Depending on your version of Ubuntu, libgdbm6 won't be available.
    # In that case, try an earlier version such as libgdbm5.
    sudo apt install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev
  2. Install rbenv using the Basic GitHub Checkout instructions (I'm not using rbenv-installer because I don't want rbenv installed via Homebrew on macOS):

    git clone https://github.com/rbenv/rbenv.git ~/.rbenv
  3. Optionally, try to compile dynamic bash extension to speed up rbenv. Don't worry if it fails; rbenv will still work normally:

    cd ~/.rbenv && src/configure && make -C src
    
  4. Restart the shell to make sure rbenv is available

    rbenv --version
  5. Install ruby-build plugin that lets you easily install Ruby versions:

    mkdir -p "$(rbenv root)"/plugins
    git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
  6. Verify the state of your rbenv installation:

    curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-doctor | bash

pyenv Setup

pyenv is a rbenv-style version manager that lets you easily install and switch between multiple versions of Python.

  1. Install dependencies for building Python:

    sudo apt install make build-essential libssl-dev zlib1g-dev \
    libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
    libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
  2. Install pyenv using pyenv-installer:

    curl https://pyenv.run | bash
  3. Optionally, try to compile a dynamic Bash extension to speed up Pyenv. Don't worry if it fails; Pyenv will still work normally:

    cd ~/.pyenv && src/configure && make -C src
  4. Verify the state of your pyenv installation:

    pyenv doctor

🔐 GitHub Commit Verification Setup

This allows git commits made via the GitHub web UI to be verified locally (e.g. git verify-commit <commit>:

curl https://github.com/web-flow.gpg | gpg --import
gpg --edit-key noreply@github.com trust quit # choose option 5 = I trust ultimately

🐍 Install python-based tools via pipx

pre-commit Setup

pre-commit is a framework for managing git pre-commit hooks.

pipx install pre-commit

# automatically enabling pre-commit on repositories
# https://pre-commit.com/#automatically-enabling-pre-commit-on-repositories
pre-commit init-templatedir ~/.git-template

poetry Setup

poetry is a tool for dependency management and packaging in Python.

pipx install poetry

pdm Setup

PDM is a modern Python package manager with PEP 582 support. It installs and manages packages in a similar way to npm that doesn't need to create a virtualenv at all!

pipx install pdm

hatch Setup

Hatch is a modern, extensible Python project manager. See the Why Hatch? page for more information.

pipx install hatch

License Information

This repository is compliant with version 3.0 of the REUSE Specification.

License files are contained in the LICENSES/ directory and additional license & copyright information can be found in .reuse/dep5.

Run the following for detailed copyright & license information on individual files:

pip install reuse
reuse spdx

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages