sudo ./bin/bootstrap.sh
This repo is my one command setup for a fresh Mac. It installs Nix, applies a nix-darwin
system configuration, wires in Home Manager for user level dotfiles, and brings in my apps and CLI tools. It also applies a few macOS defaults so the machine feels right from the start.
The bin/bootstrap.sh
script is the entry point. It runs with set -euo pipefail
for safety and walks through these steps:
- Verifies the OS is macOS.
- Caches sudo so you are not prompted repeatedly.
- Ensures Xcode Command Line Tools are present. If they are missing it kicks off the Apple installer and waits until it finishes.
- On Apple Silicon it installs Rosetta if needed.
- Installs Nix using the Determinate Systems installer in multi user mode.
- Exposes Nix in the current shell and enables flakes and
nix-command
for the session. - Applies the system configuration with
nix-darwin
using the flake atnix-darwin#kpm
. - Prints a completion message. Some changes require a new shell or log out and in.
- Nix flakes: reproducible inputs and outputs for the system configuration.
- nix-darwin: manages macOS system settings and system packages declaratively.
- Home Manager: manages user level programs and dotfiles.
- Determinate Systems installer: fast and reliable Nix install on macOS.
From nix-darwin
and home-manager
the flake installs these packages by default:
- Apps: 1Password, ChatGPT, Cursor, Google Chrome, iTerm2, Obsidian, Postman, Raycast, Shottr, Slack.
- Terminal: Neovim, oh my posh, oh my zsh, zoxide.
- Dev utilities: asdf, GitHub CLI, git, Graphite CLI.
-
User and shell
- Sets the login shell for
kyle
tozsh
from Nix packages.
- Sets the login shell for
-
Zsh setup
- Enables oh my zsh with the
agnoster
theme and pluginsgit
,npm
,history
, andnode
. - Adds Nix paths to
PATH
so Nix binaries are available. - Sources
~/.computer/zsh/evals.zsh
and~/.computer/zsh/aliases.zsh
if present. - Initializes
asdf
and shell completions.
- Enables oh my zsh with the
-
Git
- Uses the full git build with helpers and configures the
osxkeychain
credential helper.
- Uses the full git build with helpers and configures the
-
Neovim
- Home Manager links
~/.config/nvim
to~/.computer/nvim
so my editor config is versioned in this repo.
- Home Manager links
-
macOS defaults
- Dock auto hide on, orientation left, no recents, no magnification, slightly faster auto hide animation.
You can re run the bootstrap safely. If Nix is already installed the script skips the install and only switches to the flake configuration. You can also switch directly with this command:
nix-rebuild
- If the
nix
command is not found after the first run open a new terminal window and try again. - The Xcode Command Line Tools step can open a system dialog. Let it finish before you expect the script to continue.
- On Apple Silicon Rosetta install is best effort. It is fine if it is already installed.