1 { config, lib, pkgs, ... }:
3 cfg = config.hardware.opentabletdriver;
6 meta.maintainers = with lib.maintainers; [ thiagokokada ];
9 hardware.opentabletdriver = {
10 enable = lib.mkOption {
12 type = lib.types.bool;
14 Enable OpenTabletDriver udev rules, user service and blacklist kernel
15 modules known to conflict with OpenTabletDriver.
19 blacklistedKernelModules = lib.mkOption {
20 type = lib.types.listOf lib.types.str;
21 default = [ "hid-uclogic" "wacom" ];
23 Blacklist of kernel modules known to conflict with OpenTabletDriver.
27 package = lib.mkPackageOption pkgs "opentabletdriver" { };
30 enable = lib.mkOption {
32 type = lib.types.bool;
34 Whether to start OpenTabletDriver daemon as a systemd user service.
41 config = lib.mkIf cfg.enable {
42 environment.systemPackages = [ cfg.package ];
44 services.udev.packages = [ cfg.package ];
46 boot.blacklistedKernelModules = cfg.blacklistedKernelModules;
48 systemd.user.services.opentabletdriver = with pkgs; lib.mkIf cfg.daemon.enable {
49 description = "Open source, cross-platform, user-mode tablet driver";
50 wantedBy = [ "graphical-session.target" ];
51 partOf = [ "graphical-session.target" ];
55 ExecStart = "${cfg.package}/bin/otd-daemon";
56 Restart = "on-failure";