Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New NixOS Module is broken. Permissions denied #544

Closed
leifhelm opened this issue May 23, 2022 · 7 comments
Closed

New NixOS Module is broken. Permissions denied #544

leifhelm opened this issue May 23, 2022 · 7 comments

Comments

@leifhelm
Copy link

Hey,

I tried the new kmonad module and the service is not starting.

This is the log from systemctl

Mai 23 13:51:22 desktop systemd[1]: Started KMonad for /dev/input/by-id/usb-Razer_Razer_Huntsman_Elite-if01-event-kbd.
Mai 23 13:51:22 desktop kmonad-razer-huntsman-start[1502]: kmonad: /dev/input/by-id/usb-Razer_Razer_Huntsman_Elite-if01-event-kbd: openFd: permission denied (Permission denied)
Mai 23 13:51:22 desktop systemd[1]: kmonad-razer-huntsman.service: Main process exited, code=exited, status=1/FAILURE

And this is my configuration

{
  services.kmonad = {
    enable = true;
    keyboards = {
      razer-huntsman = {
        device = "/dev/input/by-id/usb-Razer_Razer_Huntsman_Elite-if01-event-kbd";
        fallthrough = true;
        allowCommands = false;
        config = builtins.readFile ./keyboard.kbd;
      };
    };
  };
}

I removed defcfg portion in the keyboard.kbd file

@pjones have I misconfigured the module? Am I missing an option?

BR

@pjones
Copy link
Contributor

pjones commented May 23, 2022

@leifhelm Can you tell me the group of that device file? It should be uinput as assigned by the udev rule.

@leifhelm
Copy link
Author

ls -l /dev/input/by-id/usb-Razer_Razer_Huntsman_Elite-if01-event-kbd
lrwxrwxrwx 1 root root 9 23. Mai 23:25 /dev/input/by-id/usb-Razer_Razer_Huntsman_Elite-if01-event-kbd -> ../event3

And

ls -l /dev/uinput
crw-rw---- 1 root uinput 10, 223 23. Mai 23:25 /dev/uinput

I hope that is what you asked for

@pjones
Copy link
Contributor

pjones commented May 23, 2022

@leifhelm Have you disconnected your keyboard (and then reconnected) or rebooted since upgrading to the latest NixOS module? I bet that the new udev rule hasn't run for that device, but if you disconnect and reconnect it will.

@leifhelm
Copy link
Author

leifhelm commented May 23, 2022

I have had rebooted my system

@pjones
Copy link
Contributor

pjones commented May 23, 2022

Can you show me the ownership and group information for /dev/input/event3?

I'm expecting the owner to be root, the group to be input and the mode to be 660 (rw-rw----). The kmonad service runs with the ability to read files that are in the input and uinput groups. So if your permissions aren't what I'm expecting we'll need to figure out why.

@leifhelm
Copy link
Author

leifhelm commented May 24, 2022

It is actually openrazer

ls -l /dev/input/event3
crw-rw---- 1 root openrazer 13, 67 24. Mai 12:21 /dev/input/event3

I am running the openrazer daemon to control the RGB on my keyboard.
When adding

{
  users.users.kmonad.extraGroups = [ "openrazer" ];
}

it works fine.
My user account is also in the openrazer group.

@pjones
Copy link
Contributor

pjones commented May 24, 2022

Okay, that makes sense then.

Perhaps we should add an option to the NixOS module to make it easier to add more groups. I'll work something up.

Thanks for working with me on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants