[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.

I found out why it did not start. In wayland.windowManager.river.extraConfig I have added line to start rivertile without & which blocked further execution of init file. When river ran init script, it never reached commands which add systemd integration. However, when I started init script manually, it skipped running rivertile because it was already running and systemd integration commands were run.

So, I just had to replace:

-rivertile
+rivertile &
1 Like