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-commandfor the session. - Applies the system configuration with
nix-darwinusing 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
kyletozshfrom Nix packages.
- Sets the login shell for
-
Zsh setup
- Enables oh my zsh with the
agnostertheme and pluginsgit,npm,history, andnode. - Adds Nix paths to
PATHso Nix binaries are available. - Sources
~/.computer/zsh/evals.zshand~/.computer/zsh/aliases.zshif present. - Initializes
asdfand shell completions.
- Enables oh my zsh with the
-
Git
- Uses the full git build with helpers and configures the
osxkeychaincredential helper.
- Uses the full git build with helpers and configures the
-
Neovim
- Home Manager links
~/.config/nvimto~/.computer/nvimso 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
nixcommand 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.