From 134695806cd26998df9db4d0d036c860f8200242 Mon Sep 17 00:00:00 2001 From: Bernardo Magri Date: Thu, 11 Jun 2026 20:53:21 +0100 Subject: [PATCH] =?UTF-8?q?fix(install):=20stage=20the=20pre-activation=20?= =?UTF-8?q?script=20in=20/root=20=E2=80=94=20nixos-enter=20tmpfs-mounts=20?= =?UTF-8?q?/tmp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The HM pre-activation never ran: the script was written to /mnt/tmp and nixos-enter mounts a fresh tmpfs over /tmp inside the chroot, so `bash /tmp/...` found nothing and the best-effort guard swallowed it. Verified interactively that every inner step (path: build as root, runuser leg) works in the chroot — only the staging path was broken. Now staged in /root, with set -x logging persisted to /var/log/nomarchy-hm-preactivate.log on the target and the tail echoed into the install transcript on failure. Co-Authored-By: Claude Fable 5 --- pkgs/nomarchy-install/nomarchy-install.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pkgs/nomarchy-install/nomarchy-install.sh b/pkgs/nomarchy-install/nomarchy-install.sh index 0d7b27d..de0e730 100644 --- a/pkgs/nomarchy-install/nomarchy-install.sh +++ b/pkgs/nomarchy-install/nomarchy-install.sh @@ -464,10 +464,13 @@ success "System installed (bootloader in place)" # fully themed desktop, not bare Hyprland. Best-effort: a failure here # only costs the user one `home-manager switch` after logging in. section "Baking the desktop" -cat > /mnt/tmp/nomarchy-hm-activate.sh < /mnt/root/nomarchy-hm-activate.sh < /var/log/nomarchy-hm-preactivate.log 2>&1 export PATH=/run/current-system/sw/bin:\$PATH -export NIX_CONFIG=$(printf '%q' "$NIX_CONFIG") out=\$(nix --extra-experimental-features "nix-command flakes" \ build --no-link --print-out-paths \ --option substituters "" \ @@ -476,13 +479,15 @@ install -d -o "$USERNAME" -g users /nix/var/nix/profiles/per-user/$USERNAME install -d -o "$USERNAME" -g users /nix/var/nix/gcroots/per-user/$USERNAME runuser -u "$USERNAME" -- bash -lc "USER=$USERNAME HOME=/home/$USERNAME \$out/activate" EOF -if nixos-enter --root /mnt -- bash /tmp/nomarchy-hm-activate.sh; then +if nixos-enter --root /mnt -- bash /root/nomarchy-hm-activate.sh; then success "Desktop pre-activated — first boot is fully themed" else - warn "Desktop pre-activation failed; after first login run:" + warn "Desktop pre-activation failed (see /var/log/nomarchy-hm-preactivate.log" + warn "on the installed system); after first login run:" warn " home-manager switch --flake ~/.nomarchy -b bak" + tail -n 5 /mnt/var/log/nomarchy-hm-preactivate.log 2>/dev/null || true fi -rm -f /mnt/tmp/nomarchy-hm-activate.sh +rm -f /mnt/root/nomarchy-hm-activate.sh header "Nomarchy installed on $TARGET_DISK" \ "User: $USERNAME @ $HOSTNAME_" \