diff --git a/pkgs/nomarchy-install/nomarchy-install.sh b/pkgs/nomarchy-install/nomarchy-install.sh index 7ad186a..83f96de 100644 --- a/pkgs/nomarchy-install/nomarchy-install.sh +++ b/pkgs/nomarchy-install/nomarchy-install.sh @@ -54,6 +54,15 @@ if [[ $EUID -ne 0 ]]; then exec sudo --preserve-env "$0" "$@" fi +# `sudo --preserve-env` (needed to carry the NOMARCHY_* vars) also drags in +# the live session user's HOME=/home/nomarchy. Root-run `nix` calls below +# would then scribble an eval cache + .nix-defexpr into /home/nomarchy — +# and the in-chroot one lands on the TARGET disk as a stray, orphaned +# /home/nomarchy (no such user on the installed system). Pin root's own +# HOME so every root nix invocation stays in /root; the user activation +# sets HOME=/home/$USERNAME explicitly and is unaffected. +export HOME=/root + header "Nomarchy installer" "NixOS, themed and ready to go." [[ -d /sys/firmware/efi ]] \ @@ -628,6 +637,8 @@ cat > /mnt/root/nomarchy-hm-activate.sh < /var/log/nomarchy-hm-preactivate.log 2>&1 export PATH=/run/current-system/sw/bin:\$PATH +# Keep root's nix state in /root, not a stray /home/nomarchy on the target. +export HOME=/root # Normally pre-built in the live env and copied over; the in-chroot # build (default substituters — the live-side build already proved the # no-network case) is a last-resort fallback.