2018-09-21 09:13:49 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.ratbagd;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
###### interface
|
|
|
|
|
|
|
|
options = {
|
|
|
|
services.ratbagd = {
|
2024-04-13 12:54:15 +00:00
|
|
|
enable = mkEnableOption "ratbagd for configuring gaming mice";
|
2024-01-26 21:58:44 +00:00
|
|
|
|
|
|
|
package = mkPackageOption pkgs "libratbag" { };
|
2018-09-21 09:13:49 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
# Give users access to the "ratbagctl" tool
|
2024-01-26 21:58:44 +00:00
|
|
|
environment.systemPackages = [ cfg.package ];
|
2018-09-21 09:13:49 +00:00
|
|
|
|
2024-01-26 21:58:44 +00:00
|
|
|
services.dbus.packages = [ cfg.package ];
|
2018-09-21 09:13:49 +00:00
|
|
|
|
2024-01-26 21:58:44 +00:00
|
|
|
systemd.packages = [ cfg.package ];
|
2018-09-21 09:13:49 +00:00
|
|
|
};
|
|
|
|
}
|