Unable to start kanata service. Seems like SupplementaryGroups have no effect

I am trying to start the kanata service on nixos-24.11 using this config.

I get the following. But looking at the service definition, it seems that the user is correctly configured to have the input and uinput groups.

sudo nixos-rebuild switch --show-trace --flake .#
# ...
warning: the following units failed: kanata-neo-integrated.service
× kanata-neo-integrated.service
# ...
    Process: 123 ExecStart=/nix/store/v4q15q428iyw2xpm56nqq8zn3aw70ia4-kanata-1.8.1/bin/kanata --cfg /nix/store/ili55kmk0gjgrp1lschfxqnq4nr58mbz-kanata-neo-integrated-config.kdb --symlink-path ${RUNTIME_DIRECTORY}/neo-integrated (code=exited, status=1/FAILURE)
# ...
kanata[123]: 15:36:31.1912 [INFO] process unmapped keys: true
kanata[123]: 15:36:31.1914 [INFO] NOTE: kanata was compiled to never allow cmd
kanata[123]: 15:36:31.1925 [INFO] config file is valid
kanata[123]: 15:36:31.1926 [ERROR] Failed to open the output uinput device. Make sure you've added the user executing kanata to the `uinput` group
kanata[123]: 15:36:31.1926 [ERROR] Permission denied (os error 13)
kanata[123]: Press enter to exit
kanata[123]: Error: Permission denied (os error 13)
systemd[1]: kanata-neo-integrated.service: Main process exited, code=exited, status=1/FAILURE
# ...

then I tried to replace the ExecStart to look at the groups using the following line :

systemd.services."kanata-neo-integrated".serviceConfig.ExecStart = lib.mkForce (lib.getExe' pkgs.toybox "groups");

looking at systemctl log, I get kanata-neo-integrated nogroup nogroup, which seems to indicate that the user is not correctly added the groups. Yet, I cannot find anyone that had this problem online.

(This message was first posted on the unofficial NixOS Discord server. I’ll link the thread there to this discussion.)

Well, I tried again today and it just worked. I didn’t update my inputs or anything. Maybe a reboot helped?