[home-manager] river doesn't start graphical-session.target

Hi. I am using home-manager on ArchLinux. I have enabled systemd integration for river

wayland.windowManager.river.systemd.enable = true;

which generates in ~/config/river/init:

### SYSTEMD INTEGRATION ###
/nix/store/sc2vj3101xz24yq1inrjqladw88c5s21-dbus-1.14.10/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE && systemctl --user stop river-session.target && systemctl --user start river-session.target

However, river doesn’t start the target

But it can be launched manually with systemctl --user start river-session.target or by running ~/.config/river/init again

How to fix this?

I use a display manager with auto login to start river. How do you login?

With greetd systemd service installed via pacman, command = "agreety --cmd river"

I disabled it and run river after login. It still doesn’t launch target

I use greetd auto login with the following command dbus-run-session river.

That also doesn’t fix the problem.

I ended up launching daemons with WM and managing config files with home.file.