diff --git a/Makefile b/Makefile index 1037727..89306a1 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ NIX = /nix/var/nix/profiles/default/bin/nix .DEFAULT_GOAL := switch bootstrap: + @test -n "$(HOST)" || { echo "usage: make bootstrap HOST=" >&2; exit 1; } @xcode-select -p > /dev/null 2>&1 || \ { xcode-select --install; \ echo "Command Line Tools installer started; re-run 'make bootstrap' once it finishes." >&2; \ @@ -10,7 +11,7 @@ bootstrap: @test -x $(NIX) || \ curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix \ | sh -s -- install --determinate --no-confirm - $(NIX) run .#bootstrap + $(NIX) run .#bootstrap -- $(HOST) switch: $(NIX) run .#switch diff --git a/README.md b/README.md index f588fc1..3a2d8bd 100644 --- a/README.md +++ b/README.md @@ -32,19 +32,20 @@ VM=nixden HMCFG=nixden nix run .#home ## Bootstrap fresh Mac -Stock macOS only needs `make` after the Xcode Command Line Tools are available: +Stock macOS only needs the host name (one of `hosts/`): ```sh -xcode-select --install -make +make bootstrap HOST=pro ``` -`make` is intentionally only a pre-Nix bootstrap shim. It installs Nix with the -Determinate Systems installer if needed, then delegates to `nix run .#bootstrap`. -The flake app installs Homebrew if absent and runs the first nix-darwin switch. +`make bootstrap` is intentionally only a pre-Nix shim. It starts the Xcode +Command Line Tools installer if they are missing, installs Nix with the +Determinate Systems installer if needed, then delegates to +`nix run .#bootstrap -- `. The flake app installs Homebrew if absent +and runs the first nix-darwin switch. Open a new terminal afterwards so the freshly installed tools are on `PATH`. -Thereafter use the flake apps above. +Thereafter plain `make` (= `nix run .#switch`) converges the machine. If the login shell does not change automatically, run once: