NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.74k stars 13.17k forks source link

hardware.logitech.wireless.enableGraphical should also add the user to the uinput #191303

Open dedsm opened 1 year ago

dedsm commented 1 year ago

Describe the bug

When using wayland, solaar depends on uinput being writable by the user to offer some functionalities (for example, the thumb wheel on an MX Master 3 does not work without it).

By enabling uinput and adding the user to the uinput group, this is solved.

Steps To Reproduce

Steps to reproduce the behavior:

  1. set hardware.logitech.wireless.enableGraphical to true
  2. make sure hardware.uinput.enable is false
  3. side wheel on MX Master 3 doesn't work

Expected behavior

Side wheel should work, also refer to https://pwr-solaar.github.io/Solaar/rules.html for a better explanation as to what to expect when running on wayland

Additional context

hardware.uinput.enable = true;
users.users.<user>.extraGroups = [ "uinput" ];

Makes the problem go away, it would be nice to have this as an option or automatically applied somehow by enabling solaar.

Notify maintainers

@spinus @ysndr @oxalica @peterhoeg

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.19.3, NixOS, 22.05 (Quokka), 22.05.3050.d86a4619b7e`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.8.1`
 - channels(root): `"home-manager-22.05.tar.gz, nixos-22.05, nixos-unstable"`
 - channels(david): `"home-manager-22.05.tar.gz, nixos-unstable"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
Artturin commented 1 year ago

we can't do it automatically but a users option like in https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/programs/weylus.nix can be done

the uinput enabling should be added to https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/hardware/logitech.nix

peterhoeg commented 1 year ago

We shouldn't have to fiddle with groups if instead permissions are granted to the current user at the active seat. We'd still need module support of course, but messing with groups shouldn't be needed.