aboutsummaryrefslogtreecommitdiff
path: root/modules/services/wooting.nix
blob: fdc6ba842e5537caf56357ad03e71491bf7f0431 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{
  config,
  lib,
  pkgs,
  ...
}:

{
  options.nx.services.wooting.enable = lib.mkEnableOption "Wootility service";
  condition = config.services.udev.enable {
    services.udev.extraRules = ''
      		# Wooting One Legacy
      		SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="ff01", TAG+="uaccess"
      		SUBSYSTEM=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="ff01", TAG+="uaccess"

      		# Wooting One update mode
      		SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2402", TAG+="uaccess"

      		# Wooting Two Legacy
      		SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="ff02", TAG+="uaccess"
      		SUBSYSTEM=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="ff02", TAG+="uaccess"

      		# Wooting Two update mode
      		SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2403", TAG+="uaccess"

      		# Generic Wootings
      		SUBSYSTEM=="hidraw", ATTRS{idVendor}=="31e3", TAG+="uaccess"
      		SUBSYSTEM=="usb", ATTRS{idVendor}=="31e3", TAG+="uaccess"
      	'';

    environment.systemPackages = with pkgs; [
      wootility
    ];
  };
}