A reminder of how to set up my dotfiles on a new machine.
Prerequisite on Ubuntu (e.g. a fresh Docker container) — the Homebrew installer needs curl and git:
sudo apt install curl gitFollow the instructions at https://brew.sh/:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"After installing, if you want to use brew one time only (without polluting your rc files), load it into the current shell (Linux):
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv bash)"On macOS, use
eval "$(/opt/homebrew/bin/brew shellenv bash)"instead.
Alternative: Nix Package Manager
sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install)or,
sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --no-daemonpersonal choice, especially inside a container
. $HOME/.nix-profile/etc/profile.d/nix.shNote: nix-command and flakes are automatically enabled with chezmoi apply.
brew install zsh chezmoi nushellNote: the package is
nushell, notnu.
Alternative: zsh via system package manager
sudo pacman -S zshsudo dnf install zshsudo apt install zshAlternative: chezmoi via Nix
nix --extra-experimental-features nix-command --extra-experimental-features flakes profile install nixpkgs#chezmoiThen apply:
# github handle after --apply
chezmoi init --apply vimkimchezmoi init --apply only clones when the source directory does not exist
yet; it does not pull remote updates. To sync a patch made on another machine,
either pull-and-apply in one step:
chezmoi updateor, when the machine might have local edits worth checking first:
chezmoi git pull -- --autostash --rebase # just pull the source repo
chezmoi diff # see what apply would change
chezmoi apply # apply when happyNone of these are hard requirements — config.nu quietly skips every tool that is not installed. Recommended for the interactive experience (prompt, history, completions; without carapace, Tab-completion for external commands does not work):
brew install starship atuin carapaceOptional tools
Optional tools used by aliases and helper commands (e.g. eza for l,
fzf/fd/ripgrep for the pickers, lazygit for lz, delta as the git/lazygit
pager):
brew install eza fzf fd ripgrep lazygit deltaMisc dependencies:
brew install mise direnv zoxide fastfetch diffnav ghOptional Step: Install oh-my-zsh
I now use nushell instead, by the way.
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
mv .zshrc.pre-oh-my-zsh .zshrcOptional Step: Other nix packages
Only if you installed Nix. This might take some time and disk spaces.
my-nix-install.shcd $HOME/.config
git clone https://github.com/vimkim/nvimsudo dnf install xauth
sudo apt install xauth
sudo pacman -S xorg-xauth# /etc/ssh/sshd_config
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes