fix(install): run a nix-daemon for the chroot HM activation + backup collisions
The pre-activation log (now persisted) showed activate dying at its
profile operation: as the target user with no daemon in the chroot,
nix can't open the store db ("big-lock: Permission denied"). Run a
temporary nix-daemon inside the chroot and point activate at it via
NIX_REMOTE=daemon. HOME_MANAGER_BACKUP_EXT=bak makes file collisions
(e.g. a stray autogenerated hyprland.conf) move aside instead of
aborting. Verified in the chroot on a real installed disk: HM symlinks
land, collision backed up.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -477,7 +477,16 @@ out=\$(nix --extra-experimental-features "nix-command flakes" \
|
||||
"path:/home/$USERNAME/.nomarchy#homeConfigurations.$USERNAME.activationPackage")
|
||||
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"
|
||||
# activate's profile ops need store access; as the user that means a
|
||||
# daemon, and the chroot has none — run one for the duration.
|
||||
nix-daemon &
|
||||
daemon_pid=\$!
|
||||
trap 'kill \$daemon_pid 2>/dev/null || true' EXIT
|
||||
sleep 2
|
||||
# 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"
|
||||
EOF
|
||||
if nixos-enter --root /mnt -- bash /root/nomarchy-hm-activate.sh; then
|
||||
success "Desktop pre-activated — first boot is fully themed"
|
||||
|
||||
Reference in New Issue
Block a user