fix(install): bake dconf, seed main, name ISO, display modes (#123–#126)
Some checks failed
Check / eval (push) Has been cancelled
Some checks failed
Check / eval (push) Has been cancelled
Batch of existing-bug fixes from Acer/XPS install findings: - #123: HM pre-activate creates /run/user/$UID and prefers dbus-run-session so dconf no longer aborts the desktop bake - #124: main-built ISOs seed ?ref=main; patch-template rewrites inputs.nomarchy.url from NOMARCHY_FLAKE_URL (was set but unused) - #125: image.baseName → nomarchy-live-….iso (not nixos-live-…) - #126: Display mode list sorted by pixel area; toast shows hyprctl size; TESTING notes QEMU fixed-window scaling illusion Verified: V0 flake check, installer-safety, baseName eval, patch-template flakeUrl rewrite, mode-sort fixture.
This commit is contained in:
@@ -621,7 +621,8 @@ python3 "$SHARE/patch-template.py" "$FLAKE_DIR" <<PYJSON
|
||||
"npu": $(if [[ -n "$NPU_VENDOR" ]]; then printf '%s' "$NPU_VENDOR" | python3 -c 'import json,sys; print(json.dumps(sys.stdin.read().rstrip("\n")))'; else echo null; fi)
|
||||
},
|
||||
"resumeOffset": $resume_json,
|
||||
"rootUuid": $root_uuid_json
|
||||
"rootUuid": $root_uuid_json,
|
||||
"flakeUrl": $(printf '%s' "${NOMARCHY_FLAKE_URL:?NOMARCHY_FLAKE_URL unset}" | python3 -c 'import json,sys; print(json.dumps(sys.stdin.read().rstrip("\n")))')
|
||||
}
|
||||
PYJSON
|
||||
|
||||
@@ -771,10 +772,28 @@ nix-daemon &
|
||||
daemon_pid=\$!
|
||||
trap 'kill \$daemon_pid 2>/dev/null || true' EXIT
|
||||
sleep 2
|
||||
# Pre-activate has no graphical session: without XDG_RUNTIME_DIR, HM's
|
||||
# dconfSettings step dies ("Unable to create directory /run/user/UID/dconf:
|
||||
# Permission denied") and the rest of activation never runs — first boot
|
||||
# then lands half-themed (#123). Create a private runtime dir the target
|
||||
# user owns, and wrap activate in a session bus (dconf needs one).
|
||||
uid=$USER_UID
|
||||
install -d -o "$USERNAME" -g users -m 700 "/run/user/\$uid"
|
||||
# BACKUP_EXT: collisions can't abort the activation (a stray
|
||||
# autogenerated config gets moved aside instead).
|
||||
runuser -u "$USERNAME" -- bash -lc \
|
||||
"USER=$USERNAME HOME=/home/$USERNAME NIX_REMOTE=daemon HOME_MANAGER_BACKUP_EXT=bak \$out/activate"
|
||||
if command -v dbus-run-session >/dev/null 2>&1; then
|
||||
runuser -u "$USERNAME" -- env \
|
||||
USER="$USERNAME" HOME="/home/$USERNAME" \
|
||||
XDG_RUNTIME_DIR="/run/user/\$uid" \
|
||||
NIX_REMOTE=daemon HOME_MANAGER_BACKUP_EXT=bak \
|
||||
dbus-run-session -- "\$out/activate"
|
||||
else
|
||||
runuser -u "$USERNAME" -- env \
|
||||
USER="$USERNAME" HOME="/home/$USERNAME" \
|
||||
XDG_RUNTIME_DIR="/run/user/\$uid" \
|
||||
NIX_REMOTE=daemon HOME_MANAGER_BACKUP_EXT=bak \
|
||||
"\$out/activate"
|
||||
fi
|
||||
EOF
|
||||
# NOMARCHY_TEST_FORCE_HM_FAIL=1 — unattended harness only (#54 V2): take
|
||||
# the failure arm so the durable recovery hint is exercised without a
|
||||
|
||||
@@ -57,6 +57,17 @@ def patch_flake(text: str, v: dict) -> str:
|
||||
f'username = "{nix_str(v["username"])}"; # <- your login name',
|
||||
"flake username",
|
||||
)
|
||||
# ISO build bakes the ref it was built from (main vs v1). Must match the
|
||||
# option surface the installer writes into system.nix (#124).
|
||||
if v.get("flakeUrl"):
|
||||
text, n = re.subn(
|
||||
r'inputs\.nomarchy\.url = "[^"]*";',
|
||||
f'inputs.nomarchy.url = "{nix_str(v["flakeUrl"])}";',
|
||||
text,
|
||||
count=1,
|
||||
)
|
||||
if n != 1:
|
||||
sys.exit("patch-template: could not patch inputs.nomarchy.url")
|
||||
profiles = v.get("hardwareProfiles") or []
|
||||
if profiles:
|
||||
items = " ".join(f'"{nix_str(p)}"' for p in profiles)
|
||||
|
||||
Reference in New Issue
Block a user