From 29818d2fb6e8a106760d43ab7634077c5fcba648 Mon Sep 17 00:00:00 2001 From: Bernardo Magri Date: Thu, 11 Jun 2026 10:01:49 +0100 Subject: [PATCH] fix(install): offline installs copy the ISO store into the target up front MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Substituter plumbing through nixos-install proved unreliable (env config is overridden by its hardcoded flags; the forwarded --substituters flag still left the plan building gcc from source). Make every ISO path valid in the target store with one nix copy --all before nixos-install — the in-target build then resolves everything locally and only the per-machine config drvs are built. Co-Authored-By: Claude Fable 5 --- pkgs/nomarchy-install/nomarchy-install.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/nomarchy-install/nomarchy-install.sh b/pkgs/nomarchy-install/nomarchy-install.sh index 4509874..e957b97 100644 --- a/pkgs/nomarchy-install/nomarchy-install.sh +++ b/pkgs/nomarchy-install/nomarchy-install.sh @@ -437,6 +437,18 @@ else warn "flake archive failed — first rebuild will need network." fi +# Offline: sidestep substituter plumbing entirely — make every ISO store +# path valid in the target store up front. nixos-install's in-target +# build then finds all build tools locally and only the per-machine +# config derivations are built. (Two earlier attempts to route this +# through substituters — env config and the forwarded --substituters +# flag — still left the plan building gcc from source.) +if [[ ${#NIXOS_INSTALL_OPTS[@]} -gt 0 ]]; then + info "Copying the ISO store into the target (offline install)..." + nix --extra-experimental-features nix-command \ + copy --all --no-check-sigs --to "local?root=/mnt" +fi + nixos-install --no-root-passwd "${NIXOS_INSTALL_OPTS[@]}" --flake "$FLAKE_DIR#default" success "System installed (bootloader in place)"