I wonder if there’s a better / faster way? Maybe using systemd to automatically start the window manager?
Note: I know this isn’t 100% related to NixOS as this also happens on all other distro, but I couldn’t find any ressources, so I figured asking here is as good as any other places.
AFAIK you must go through the whole getty → login → wm sequence in order to run something as your user.
Maybe you could create a fake display manager that runs as root (in order to acquire a screen) and then does setuid or something like that to start river as your user. Try looking into services.displayManager.execCmd.
That’d still result in some flashing. gdm/sddm do a fair bit of stuff to achieve a flicker-free handover from plymouth. I don’t think any console DMs support that because passing through the tty requires a cycle of modesetting, you’re probably best off using a real DM’s autologin if you want to avoid that.
If it’s specifically the tty login text you want to avoid, something like greetd might be more your taste, depending on what you consider “lightweight”.