From 727f21005d7d9fe05855c3cd9b2562d8401e99a4 Mon Sep 17 00:00:00 2001 From: Bernardo Magri Date: Thu, 11 Jun 2026 19:39:09 +0100 Subject: [PATCH] fix(install): root-side flake refs must be path:, not git+file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The chown fix made the flake user-owned, and root's libgit2 then refuses git+file fetches of it ("not owned by current user") — which silently killed the seeding step under set -e and would equally break nixos-install --flake. Use path: refs for the live-side archive and the nixos-install invocation (path flakes read flake.lock, skip libgit2), and make seeding failure non-fatal as intended. Co-Authored-By: Claude Fable 5 --- pkgs/nomarchy-install/nomarchy-install.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/nomarchy-install/nomarchy-install.sh b/pkgs/nomarchy-install/nomarchy-install.sh index 4b7f8c8..0d7b27d 100644 --- a/pkgs/nomarchy-install/nomarchy-install.sh +++ b/pkgs/nomarchy-install/nomarchy-install.sh @@ -425,15 +425,17 @@ section "Installing (this takes a while)" # `flake archive --to` enforces signatures and locally-evaluated source # paths have none; plain `nix copy` accepts --no-check-sigs. info "Seeding flake inputs into the target store..." +# path: (not git+file) — the flake dir is owned by the target user and +# root's libgit2 refuses repositories owned by someone else. flake_paths=$(nix --extra-experimental-features "nix-command flakes" \ - flake archive --json "$FLAKE_DIR" 2>/dev/null \ + flake archive --json "path:$FLAKE_DIR" \ | python3 -c ' import json, sys def walk(node): yield node["path"] for child in node.get("inputs", {}).values(): yield from walk(child) -print("\n".join(walk(json.load(sys.stdin))))') +print("\n".join(walk(json.load(sys.stdin))))' || true) if [[ -n "$flake_paths" ]]; then # shellcheck disable=SC2086 nix --extra-experimental-features "nix-command flakes" \ @@ -455,7 +457,7 @@ if [[ ${#NIXOS_INSTALL_OPTS[@]} -gt 0 ]]; then copy --all --no-check-sigs --to "local?root=/mnt" fi -nixos-install --no-root-passwd "${NIXOS_INSTALL_OPTS[@]}" --flake "$FLAKE_DIR#default" +nixos-install --no-root-passwd "${NIXOS_INSTALL_OPTS[@]}" --flake "path:$FLAKE_DIR#default" success "System installed (bootloader in place)" # Pre-activate the Home Manager generation so the FIRST boot lands in the