Merge pull request #261135 from dotlambda/nixos-iptsd-init

nixos/iptsd: init

authored by

Robert Schütz and committed by
GitHub
80f59b16 695e4156

+58 -1
+1
nixos/modules/module-list.nix
··· 520 520 ./services/hardware/hddfancontrol.nix 521 521 ./services/hardware/illum.nix 522 522 ./services/hardware/interception-tools.nix 523 + ./services/hardware/iptsd.nix 523 524 ./services/hardware/irqbalance.nix 524 525 ./services/hardware/joycond.nix 525 526 ./services/hardware/kanata.nix
+53
nixos/modules/services/hardware/iptsd.nix
··· 1 + { config, lib, pkgs, ... }: 2 + 3 + let 4 + cfg = config.services.iptsd; 5 + format = pkgs.formats.ini { }; 6 + configFile = format.generate "iptsd.conf" cfg.config; 7 + in { 8 + options.services.iptsd = { 9 + enable = lib.mkEnableOption (lib.mdDoc "the userspace daemon for Intel Precise Touch & Stylus"); 10 + 11 + config = lib.mkOption { 12 + default = { }; 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. 17 + ''; 18 + type = lib.types.submodule { 19 + freeformType = format.type; 20 + options = { 21 + Touch = { 22 + DisableOnPalm = lib.mkOption { 23 + default = false; 24 + description = lib.mdDoc "Ignore all touch inputs if a palm was registered on the display."; 25 + type = lib.types.bool; 26 + }; 27 + DisableOnStylus = lib.mkOption { 28 + default = false; 29 + description = lib.mdDoc "Ignore all touch inputs if a stylus is in proximity."; 30 + type = lib.types.bool; 31 + }; 32 + }; 33 + Stylus = { 34 + Disable = lib.mkOption { 35 + default = false; 36 + description = lib.mdDoc "Disables the stylus. No stylus data will be processed."; 37 + type = lib.types.bool; 38 + }; 39 + }; 40 + }; 41 + }; 42 + }; 43 + }; 44 + 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 ]; 50 + }; 51 + 52 + meta.maintainers = with lib.maintainers; [ dotlambda ]; 53 + }
+4 -1
pkgs/applications/misc/iptsd/default.nix
··· 49 49 substituteInPlace etc/meson.build \ 50 50 --replace "install_dir: unitdir" "install_dir: '$out/etc/systemd/system'" \ 51 51 --replace "install_dir: rulesdir" "install_dir: '$out/etc/udev/rules.d'" 52 + substituteInPlace etc/systemd/iptsd-find-service \ 53 + --replace "iptsd-find-hidraw" "$out/bin/iptsd-find-hidraw" \ 54 + --replace "systemd-escape" "${lib.getExe' systemd "systemd-escape"}" 52 55 substituteInPlace etc/udev/50-iptsd.rules.in \ 53 - --replace "/bin/systemd-escape" "${systemd}/bin/systemd-escape" 56 + --replace "/bin/systemd-escape" "${lib.getExe' systemd "systemd-escape"}" 54 57 ''; 55 58 56 59 mesonFlags = [