summary refs log tree commit diff
path: root/nixos/modules/services/hardware/ratbagd.nix
blob: 103e1d2315aea9c0f3d4aaf11c0c543d7e54def8 (plain) (blame)
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
{ config, lib, pkgs, ... }:

with lib;

let
  cfg = config.services.ratbagd;
in
{
  ###### interface

  options = {
    services.ratbagd = {
      enable = mkOption {
        default = false;
        description = ''
          Whether to enable ratbagd for configuring gaming mice.
        '';
      };
    };
  };

  ###### implementation

  config = mkIf cfg.enable {
    # Give users access to the "ratbagctl" tool
    environment.systemPackages = [ pkgs.libratbag ];

    services.dbus.packages = [ pkgs.libratbag ];

    systemd.packages = [ pkgs.libratbag ];
  };
}