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"