about summary refs log tree commit diff
path: root/nixpkgs/nixos/modules/services/hardware/ratbagd.nix
blob: 5567bcbafd16085874b0a0976e18306618ae7b1b (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
{ config, lib, pkgs, ... }:

with lib;

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

  options = {
    services.ratbagd = {
      enable = mkEnableOption (lib.mdDoc "ratbagd for configuring gaming mice");

      package = mkPackageOption pkgs "libratbag" { };
    };
  };

  ###### implementation

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

    services.dbus.packages = [ cfg.package ];

    systemd.packages = [ cfg.package ];
  };
}