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 (lib.mdDoc "the userspace daemon for Intel Precise Touch & Stylus");
11 config = lib.mkOption {
13 description = lib.mdDoc ''
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 = lib.mdDoc "Ignore all touch inputs if a palm was registered on the display.";
25 type = lib.types.bool;
27 DisableOnStylus = lib.mkOption {
29 description = lib.mdDoc "Ignore all touch inputs if a stylus is in proximity.";
30 type = lib.types.bool;
34 Disable = lib.mkOption {
36 description = lib.mdDoc "Disables the stylus. No stylus data will be processed.";
37 type = lib.types.bool;
45 config = lib.mkIf cfg.enable {
46 systemd.packages = [ pkgs.iptsd ];
47 environment.etc."iptsd.conf".source = configFile;
48 systemd.services."iptsd@".restartTriggers = [ configFile ];
49 services.udev.packages = [ pkgs.iptsd ];
52 meta.maintainers = with lib.maintainers; [ dotlambda ];