diff options
author | Simon Parri <simonparri@ganzeria.com> | 2025-06-17 12:25:07 -0500 |
---|---|---|
committer | Simon Parri <simonparri@ganzeria.com> | 2025-06-17 12:25:59 -0500 |
commit | bb22fd61b23bd11bf4e4d0955fd873388670e0f3 (patch) | |
tree | dc7a8f07a42651a1192344d19bd87f34382f0aed /modules | |
parent | f888ec348252a38ebe11d95ffcff839bb3ff8e37 (diff) | |
download | nixos-config-bb22fd61b23bd11bf4e4d0955fd873388670e0f3.tar.gz nixos-config-bb22fd61b23bd11bf4e4d0955fd873388670e0f3.zip |
modules/thinkpad: Put trackpoint sensitivity settings here
Diffstat (limited to 'modules')
-rw-r--r-- | modules/thinkpad.nix | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/thinkpad.nix b/modules/thinkpad.nix index 00ccfbb..9cbcd79 100644 --- a/modules/thinkpad.nix +++ b/modules/thinkpad.nix @@ -5,11 +5,22 @@ let cfg = config.this.laptop.thinkpad; mkKeyValue = lib.generators.mkKeyValueDefault {} " "; } c; zcfanConf = mkZcfanConf cfg.zcfan.settings; + inherit (builtins) toString; in { options = { this.laptop.thinkpad = { enable = lib.mkEnableOption "thinkpad settings"; + trackpoint = { + sensitivity = lib.mkOption { + type = lib.types.int; + default = 255; + }; + speed = lib.mkOption { + type = lib.types.int; + default = 127; + }; + }; zcfan = { settings = lib.mkOption { type = with lib.types; @@ -24,6 +35,10 @@ in config = lib.mkIf cfg.enable { boot.extraModprobeConfig = "options thinkpad_acpi fan_control=1"; + services.udev.extraRules = '' + ACTION=="add", SUBSYSTEM=="input", ATTR{name}=="TPPS/2 IBM TrackPoint", ATTR{device/sensitivity}="${toString cfg.trackpoint.sensitivity}", ATTR{device/speed}="${toString cfg.trackpoint.speed}" + ''; + environment.etc."zcfan.conf" = lib.mkIf (zcfanConf != "") { text = zcfanConf; }; environment.systemPackages = [ pkgs.zcfan ]; systemd.packages = [ pkgs.zcfan ]; |