Configuration for my computer, managed by mise, chezmoi, homebrew and nix-darwin.
Provides git, which everything else depends on.
xcode-select --installInstall the binary and activate it for the current session.
curl https://mise.run | sh
eval "$(~/.local/bin/mise activate zsh)"We'll chsh to fish later on: this is just here for bootstrapping.
We need gh and chezmoi so that we can fetch and apply the dotfiles from
this repo:
mise use --global gh@latest chezmoi@latestgh auth login will offer to generate an SSH key and upload it to GitHub.
Pick SSH so we can clone (and push to) this dotfiles repo over SSH.
gh auth logininit without --apply clones the repo to ~/.local/share/chezmoi but
doesn't run any scripts — we need fish (from homebrew) installed first so
the run_onchange fisher/hydro script can fire on the eventual apply.
chezmoi init samstarling --sshWhen prompted for a GPG signing key, enter anything — we'll regenerate it in step 11.
Provides fish, gnupg, pinentry-mac.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
/opt/homebrew/bin/brew bundle --file ~/.local/share/chezmoi/Brewfilenix-darwin sets the Dock and system settings from nix/configuration.nix,
and it needs Nix. The installer asks for your password and for a yes to its
plan. Ignore its suggestion to use the macOS package instead.
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- installecho /opt/homebrew/bin/fish | sudo tee -a /etc/shells
chsh -s /opt/homebrew/bin/fishThen, start a fresh terminal to switch to fish.
The first apply sets up nix-darwin: it asks for your password, downloads
about 4 GB and takes a few minutes. Fish has no mise on its path until this
apply installs config.fish, so call it by its full path.
~/.local/bin/mise exec chezmoi -- chezmoi applyThe applied ~/.config/mise/config.toml pins everything else (bat, btop,
delta, eza, fzf, helix, jq, ripgrep, zoxide, fd, etc).
mise installECC / ED25519:
gpgconf --kill gpg-agent
gpg --full-generate-keyTake the key ID (after the slash in the sec line) and add the GitHub
no-reply email as a UID:
gpg --edit-key KEY_ID
adduid
saveTell chezmoi the new key ID and re-apply the gitconfig:
chezmoi edit-config # update signingKey
chezmoi apply ~/.gitconfigThen copy the public key and add it to GitHub:
gpg --armor --export KEY_ID | pbcopyEdit nix/configuration.nix, then run chezmoi apply. Deleting a line
doesn't undo a setting that has already been applied: set the opposite value
instead.
To remove nix-darwin and Nix:
sudo /run/current-system/sw/bin/darwin-uninstaller
/nix/nix-installer uninstall