fix(installer): resolve /etc/nomarchy symlink before getFlake
`generate_state` loads `nixpkgs.lib` for the state-schema eval via
`builtins.getFlake "$NOMARCHY_REPO"`. On the live ISO that path is a
symlink chain (/etc/nomarchy -> /etc/static/nomarchy -> /nix/store/…-source),
and Nix 2.31+ rejects getFlake on a symlink ("path '…-source' is a
symlink"), aborting every real-hardware install right after hardware
config generation — single or multi disk.
Resolve the repo to its real store directory with `realpath` at
detection so getFlake receives a plain directory. The dev-checkout
branch already used realpath, so only the live-ISO path was affected.
Reproduced and fixed in a live VM (Nix 2.31.4).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -257,9 +257,14 @@ check_environment() {
|
||||
fi
|
||||
success "UEFI boot detected"
|
||||
|
||||
# Find Nomarchy repo
|
||||
# Find Nomarchy repo. Resolve symlinks: on the live ISO /etc/nomarchy is a
|
||||
# symlink chain (/etc/nomarchy -> /etc/static/nomarchy -> /nix/store/…-source).
|
||||
# `builtins.getFlake` (used below to load nixpkgs.lib for the state-schema
|
||||
# eval) rejects a symlink path with "path '…-source' is a symlink" on Nix
|
||||
# 2.31+, which aborted every real-hardware install at "Creating system
|
||||
# configuration". Pass it the resolved store directory instead.
|
||||
if [[ -d "/etc/nomarchy" ]]; then
|
||||
NOMARCHY_REPO="/etc/nomarchy"
|
||||
NOMARCHY_REPO="$(realpath /etc/nomarchy)"
|
||||
elif [[ -d "$(dirname "$0")/.." ]] && [[ -f "$(dirname "$0")/../flake.nix" ]]; then
|
||||
NOMARCHY_REPO="$(realpath "$(dirname "$0")/..")"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user