1 { config, lib, pkgs, ... }:
4 cfg = config.services.iptsd;
5 format = pkgs.formats.ini { };
6 configFile = format.generate "iptsd.conf" cfg.config;
8 options.services.iptsd = {
9 enable = lib.mkEnableOption "the userspace daemon for Intel Precise Touch & Stylus";
11 config = lib.mkOption {
14 Configuration for IPTSD. See the
15 [reference configuration](https://github.com/linux-surface/iptsd/blob/master/etc/iptsd.conf)
16 for available options and defaults.
18 type = lib.types.submodule {
19 freeformType = format.type;
22 DisableOnPalm = lib.mkOption {
24 description = "Ignore all touchscreen inputs if a palm was registered on the display.";
25 type = lib.types.bool;
27 DisableOnStylus = lib.mkOption {
29 description = "Ignore all touchscreen inputs if a stylus is in proximity.";
30 type = lib.types.bool;
34 Disable = lib.mkOption {
36 description = "Disables the stylus. No stylus data will be processed.";
37 type = lib.types.bool;
45 config = lib.mkIf cfg.enable {
46 warnings = lib.optional (lib.hasAttr "Touch" cfg.config) ''
47 The option `services.iptsd.config.Touch` has been renamed to `services.iptsd.config.Touchscreen`.
50 systemd.packages = [ pkgs.iptsd ];
51 environment.etc."iptsd.conf".source = configFile;
52 systemd.services."iptsd@".restartTriggers = [ configFile ];
53 services.udev.packages = [ pkgs.iptsd ];
56 meta.maintainers = with lib.maintainers; [ dotlambda ];