From 7b5a22c80020f53c38f6428c356c600e0476f224 Mon Sep 17 00:00:00 2001 From: Bernardo Magri Date: Thu, 11 Jun 2026 21:51:28 +0100 Subject: [PATCH] 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 --- pkgs/nomarchy-install/nomarchy-install.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/nomarchy-install/nomarchy-install.sh b/pkgs/nomarchy-install/nomarchy-install.sh index de0e730..8ea40b6 100644 --- a/pkgs/nomarchy-install/nomarchy-install.sh +++ b/pkgs/nomarchy-install/nomarchy-install.sh @@ -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"