From a6cd721bf04482ef1756f7b4a76d29e0b036ba03 Mon Sep 17 00:00:00 2001 From: Coding Agent Date: Fri, 4 Sep 2026 23:16:21 +0000 Subject: [PATCH] fix: avoid channel evaluation during prebuilt activation Use the rebuild binary from the reviewed closure and --no-reexec. The bootstrap nixos-rebuild otherwise evaluates its own package through the old channel before honoring --store-path. The failed attempt made no live changes. --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index badc3b7..f67257a 100644 --- a/README.md +++ b/README.md @@ -39,10 +39,13 @@ New source files must be added to Git for flakes to see them. Keep `flake.lock` Review and activate exactly the built closure: ```sh -sudo nixos-rebuild dry-activate --store-path "$(readlink -f result)" -sudo nixos-rebuild switch --store-path "$(readlink -f result)" +built=$(readlink -f result) +sudo "$built/sw/bin/nixos-rebuild" dry-activate --no-reexec --store-path "$built" +sudo "$built/sw/bin/nixos-rebuild" switch --no-reexec --store-path "$built" ``` +Use the rebuild tool from that closure with `--no-reexec`: otherwise the bootstrap tool can try to rebuild itself through the old channel even when `--store-path` is supplied. Capturing `built` also keeps review and activation on the same immutable result. + For initial deployment on a compatible NixOS EC2 base where flakes are not enabled yet, check out this repo and run the build as an existing administrator with the temporary CLI flag: ```sh