| typora-copy-images-to | ./images |
|---|
My dotfiles in $HOME automatically managed by chezmoi.
Once you have Xcode installed, open a terminal and run the following to install the required command line developer tools:
xcode-select --installImportant
Homebrew 7.0 dropped support for Intel-based Macs. Use Homebrew on Apple Silicon Macs and MacPorts on Intel Macs. Where the instructions below differ, both commands are shown; run the one for your package manager.
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)"MacPorts is a package manager for macOS that still supports Intel-based Macs. Download and run the macOS package installer for your macOS version from the MacPorts installation page, then update the ports tree:
sudo port selfupdateNote
The MacPorts installer adds /opt/local/bin to PATH in ~/.zprofile, which only affects zsh. dot_profile.tmpl adds MacPorts to PATH for bash, so that line is redundant but harmless.
Install the latest versions of Git, Git LFS, and GnuPG:
# Homebrew
brew install git git-lfs gpg
# MacPorts
sudo port install git git-lfs gnupg2Install the 1Password password manager:
# Homebrew
brew install --cask 1passwordThere is no MacPorts port for the 1Password app. On Intel Macs, download it from 1password.com.
After installing, go to "Settingsβ¦" β "Developer" β "Set Up SSH Agentβ¦" and make sure the SSH agent and CLI are enabled:
With 1Password CLI, you can automate administrative tasks and load secrets straight from your command line and in your scripts.
# Homebrew
brew install --cask 1password/tap/1password-cli
# MacPorts
sudo port install 1password-cliThe older bash 3.2 provided by Apple with macOS is not compatible with modern bash completion (e.g. bash-completion 2.x requires bash 4.2+ and Click requires bash 4.4+). Instead, use a more recent bash + bash completion from your package manager:
# Homebrew
brew install bash bash-completion@2
# MacPorts
sudo port install bash bash-completionBoth install the completion loader at <prefix>/etc/profile.d/bash_completion.sh, which dot_bashrc.tmpl sources automatically.
In addition, optionally install the bash language server to enable editor extensions like Bash IDE for VSCode.
# Optional
# Homebrew
brew install bash-language-server
# MacPorts
sudo port install bash-language-serverOn macOS, if you're using a custom shell installed via Homebrew or MacPorts, remember to configure the shell in your terminal preferences.
-
Change the Command preference to the full path of your shell:
-
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 <-- Homebrew bash (Apple Silicon) /opt/local/bin/bash <-- MacPorts bash (Intel) -
To use the Terminal.app profile, just double click the
cdwilson-tomorrow-night.terminalfile in Finder.
Install the dotfiles from this repository using chezmoi.
Important
Make sure to change cdwilson to your GitHub username!
sh -c "$(curl -fsLS get.chezmoi.io/lb)" -- init cdwilson --apply --sshStarship is the minimal, blazing-fast, and infinitely customizable prompt for any shell!
Install starship:
# Homebrew
brew install starship
# MacPorts
sudo port install starshipTip
To configure Starship, add your changes to dot_config/starship.toml.
To install the Monaspace font and the Symbols Nerd Font font from Nerd Fonts:
# Homebrew
brew install --cask font-monaspace
brew install --cask font-symbols-only-nerd-fontThere are no MacPorts equivalents (the ttf-nerd-fonts-symbols port installs into /opt/local/share/fonts, which macOS does not scan), so on Intel Macs download the fonts and copy them into ~/Library/Fonts:
# MacPorts (manual install)
cd ~/Downloads
curl -sSLO https://github.com/githubnext/monaspace/releases/download/v1.400/monaspace-static-v1.400.zip
unzip -o monaspace-static-v1.400.zip -d monaspace
find monaspace -name '*.otf' -exec cp {} ~/Library/Fonts/ \;
curl -sSLO https://github.com/ryanoasis/nerd-fonts/releases/download/v3.5.1/NerdFontsSymbolsOnly.zip
unzip -o NerdFontsSymbolsOnly.zip -d SymbolsNerdFont
cp SymbolsNerdFont/*.ttf ~/Library/Fonts/Note
Although Monaspace added nerd fonts in the v1.200 release, it does not contain some of the symbols that the font-symbols-only-nerd-font font does. In addition, the nerd fonts bundled with with Monaspace are scaled so they fit within the monospaced "box", resulting in smaller icons.
To avoid these issues, the Monaspace Neon font is used (instead of Monaspace Neon NF which includes nerd fonts) and Symbols Nerd Font is configured as a fallback font which provides the nerd font icons. Terminals that do not provide a fallback font configuration option (e.g. macOS Terminal.app & GNOME Terminal) are configured to use a simplified prompt which does not use nerd fonts.
Ghostty is a fast, feature-rich, and cross-platform terminal emulator that uses platform-native UI and GPU acceleration.
# Homebrew
brew install --cask ghosttyThere is no MacPorts port for Ghostty. On Intel Macs, download the universal DMG from ghostty.org.
Tip
To configure Ghostty, add your changes to dot_config/ghostty/config.tmpl. On macOS, the template launches the MacPorts bash when /opt/local/bin/bash exists and the Homebrew bash otherwise.
uv is an extremely fast Python package and project manager, written in Rust.
curl -LsSf https://astral.sh/uv/install.sh | shdirenv lets you easily load and unload environment variables depending on the current directory.
# Homebrew
brew install direnv
# MacPorts
sudo port install direnvrbenv is a version manager that lets you easily install and switch between multiple versions of Ruby.
-
Install dependencies for building Ruby:
# Homebrew brew install openssl readline # MacPorts sudo port install openssl readline libyaml
[!NOTE] ruby-build only auto-detects Homebrew. With MacPorts, point Ruby's configure script at
/opt/localwhen installing a Ruby version:RUBY_CONFIGURE_OPTS="--with-openssl-dir=/opt/local --with-libyaml-dir=/opt/local" rbenv install <version>
-
Install
rbenvusing 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 -
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
-
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
-
Verify the state of your rbenv installation:
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-doctor | bash
eza is a modern, maintained replacement for ls.
# Homebrew
brew install eza
# MacPorts
sudo port install ezaripgrep is a line-oriented search tool that recursively searches the current directory for a regex pattern.
# Homebrew
brew install ripgrep
# MacPorts
sudo port install ripgrepbat is a cat(1) clone with syntax highlighting and Git integration.
# Homebrew
brew install bat
# MacPorts
sudo port install bat bat-extrasfzf is a general-purpose command-line fuzzy finder.
# Homebrew
brew install fzf
# MacPorts
sudo port install fzffastfetch is a maintained, feature-rich and performance oriented, neofetch like system information tool.
# Homebrew
brew install fastfetch
# MacPorts
sudo port install fastfetchGitHub CLI brings pull requests, issues, and other GitHub concepts to the terminal.
# Homebrew
brew install gh
# MacPorts
sudo port install ghThen authenticate with GitHub:
gh auth loginTip
To configure gh, add your changes to dot_config/gh/config.yml.
Update package information from the package repository and install dependencies:
sudo apt update
sudo apt upgrade
sudo apt install bash bash-completion 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-softwareInstall the latest version of Git from the package repository:
sudo apt install git git-lfs gpgcurl -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 1passwordcd ~/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/hicolorAfter installing, go to "Settingsβ¦" β "Developer" β "Set Up SSH Agentβ¦" and make sure the SSH agent and CLI are enabled:
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 --versionInstall the dotfiles from this repository using chezmoi.
Important
Make sure to change cdwilson to your GitHub username!
sh -c "$(curl -fsLS get.chezmoi.io/lb)" -- init cdwilson --apply --sshStarship is the minimal, blazing-fast, and infinitely customizable prompt for any shell!
Install starship:
curl -sS https://starship.rs/install.sh | shTip
To configure Starship, add your changes to dot_config/starship.toml.
To install the Monaspace font:
cd ~/Downloads
wget https://github.com/githubnext/monaspace/releases/download/v1.300/monaspace-static-v1.300.zip
mkdir -p ~/.local/share/fonts
rm -rf ~/.local/share/fonts/Monaspace*
mkdir -p ~/.local/share/fonts/Monaspace
unzip monaspace-static-v1.300.zip -d ~/.local/share/fonts/Monaspace/
fc-cache -fvTo install the Symbols Nerd Font font from Nerd Fonts:
cd ~/Downloads
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.4.0/NerdFontsSymbolsOnly.zip
mkdir -p ~/.local/share/fonts
rm -rf ~/.local/share/fonts/SymbolsNerdFont*
mkdir -p ~/.local/share/fonts/SymbolsNerdFont
unzip NerdFontsSymbolsOnly.zip -d ~/.local/share/fonts/SymbolsNerdFont/
fc-cache -fvNote
Although Monaspace added nerd fonts in the v1.200 release, it does not contain some of the symbols that the font-symbols-only-nerd-font font does. In addition, the nerd fonts bundled with with Monaspace are scaled so they fit within the monospaced "box", resulting in smaller icons.
To avoid these issues, the Monaspace Neon font is used (instead of Monaspace Neon NF which includes nerd fonts) and Symbols Nerd Font is configured as a fallback font which provides the nerd font icons. Terminals that do not provide a fallback font configuration option (e.g. macOS Terminal.app & GNOME Terminal) are configured to use a simplified prompt which does not use nerd fonts.
-
To use the Monaspace font:
-
To use the custom
cdwilson-tomorrow-nightcolor scheme:sudo apt install uuid-runtime chezmoi cd # 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) ./Ubuntu/color-scripts/cdwilson-tomorrow-night.sh
-
Make sure the "Run command as a login shell" is checked to ensure that
.bash_profileis sourced:
Ghostty is a fast, feature-rich, and cross-platform terminal emulator that uses platform-native UI and GPU acceleration.
sudo apt install libonig5
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/mkasberg/ghostty-ubuntu/HEAD/install.sh)"Tip
To configure Ghostty, add your changes to dot_config/ghostty/config.tmpl.
uv is an extremely fast Python package and project manager, written in Rust.
curl -LsSf https://astral.sh/uv/install.sh | shdirenv lets you easily load and unload environment variables depending on the current directory.
sudo apt install direnvrbenv is a version manager that lets you easily install and switch between multiple versions of Ruby.
-
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
-
Install
rbenvusing 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 -
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
-
Restart the shell to make sure
rbenvis availablerbenv --version
-
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
-
Verify the state of your rbenv installation:
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-doctor | bash
eza is a modern, maintained replacement for ls.
First make sure you have the gpg command, and otherwise install it via:
sudo apt update
sudo apt install -y gpgThen install eza via:
sudo mkdir -p /etc/apt/keyrings
wget -qO- https://raw.githubusercontent.com/eza-community/eza/main/deb.asc | sudo gpg --dearmor -o /etc/apt/keyrings/gierens.gpg
echo "deb [signed-by=/etc/apt/keyrings/gierens.gpg] http://deb.gierens.de stable main" | sudo tee /etc/apt/sources.list.d/gierens.list
sudo chmod 644 /etc/apt/keyrings/gierens.gpg /etc/apt/sources.list.d/gierens.list
sudo apt update
sudo apt install -y ezaripgrep is a line-oriented search tool that recursively searches the current directory for a regex pattern.
sudo apt install ripgrepbat is a cat(1) clone with syntax highlighting and Git integration.
sudo apt install batImportant
Note that the executable may be installed as batcat instead of bat (due to a name clash with another package). You can set up a bat -> batcat symlink or alias to prevent any issues that may come up because of this and to be consistent with other distributions:
mkdir -p ~/.local/bin
ln -s /usr/bin/batcat ~/.local/bin/batfzf is a general-purpose command-line fuzzy finder.
# Installing via apt currently installs fzf < 0.48.0 which is needed for the --bash option
# sudo apt install fzf
# Instead, install the latest version from GitHub via go install
# TODO: switch back to the apt method once the Ubuntu fzf package is updated >= 0.48.0
sudo apt install golang-go
go install github.com/junegunn/fzf@latestfastfetch is a maintained, feature-rich and performance oriented, neofetch like system information tool.
sudo add-apt-repository ppa:zhangsongcui3371/fastfetch
sudo apt update
sudo apt install fastfetchGitHub CLI brings pull requests, issues, and other GitHub concepts to the terminal.
Install it from the official apt repository, since the gh package in the Ubuntu archive lags behind upstream releases:
sudo mkdir -p -m 755 /etc/apt/keyrings
wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null
sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install ghThen authenticate with GitHub:
gh auth loginTip
To configure gh, add your changes to dot_config/gh/config.yml.
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 ultimatelypre-commit is a framework for managing git pre-commit hooks.
uv tool install pre-commit
# automatically enabling pre-commit on repositories
# https://pre-commit.com/#automatically-enabling-pre-commit-on-repositories
pre-commit init-templatedir ~/.git-templateThis repository is compliant with version 3.2 of the REUSE Specification.
License files are contained in the LICENSES/ directory and additional copyright & license information can be found in REUSE.toml.
Install the reuse tool and run the following commands for detailed copyright & license information on individual files:
reuse spdx






