Bootstrapping
The bootstrap.sh script handles everything needed to set up a fresh machine
from zero to a fully configured system.
One-Liner
sh -c 'curl -sSfL https://raw.githubusercontent.com/RobertDeRose/nix-config/main/bootstrap.sh | bash -s -- <hostname>'
What It Does
macOS
- Installs Xcode Command Line Tools (if missing)
- Clones this repo to
~/workspace/personal/nix-config(if not already inside it) - Creates
hosts/<arch>-darwin/<hostname>/from the darwin template (if it doesn’t exist) - Installs Homebrew (if missing)
- Installs Nix via the Determinate Systems installer (if missing)
- Runs
darwin-rebuild switchto build and activate the full configuration
Linux (Ubuntu headless)
- Clones this repo (if not already inside it)
- Creates
systems/<arch>-linux/<hostname>/from the linux template - Installs Nix (if missing)
- Builds and activates system-manager configuration
- Builds and activates home-manager configuration
After Bootstrap
Once the initial bootstrap completes, day-to-day changes are applied with:
mise run nix:switch
CI Mode
The bootstrap script supports a ci-bootstrap argument for testing in CI
without actually activating:
./bootstrap.sh ci-bootstrap
This runs the full pipeline but evaluates configurations without building, verifying the flake is valid on a fresh machine.