From dd3b25668dc853a9a8d7fd1221265cd2a18b6eeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Pacana?= Date: Sun, 26 Jul 2026 21:22:37 +0200 Subject: [PATCH] Pass the host to nix run .#bootstrap from make The bootstrap app takes the host as a positional argument (the fresh machine's LocalHostName is not a known host yet, so it cannot be derived), but the Makefile invoked it with none and it died with 'usage: bootstrap '. Require HOST= on make bootstrap and forward it. Update the README, which still described the pre-multi-host flow where plain make bootstrapped. --- Makefile | 3 ++- README.md | 15 ++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) 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: -- 2.51.2