summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Parri <simonparri@ganzeria.com>2025-06-17 12:25:07 -0500
committerSimon Parri <simonparri@ganzeria.com>2025-06-17 12:25:59 -0500
commitbb22fd61b23bd11bf4e4d0955fd873388670e0f3 (patch)
treedc7a8f07a42651a1192344d19bd87f34382f0aed
parentf888ec348252a38ebe11d95ffcff839bb3ff8e37 (diff)
downloadnixos-config-bb22fd61b23bd11bf4e4d0955fd873388670e0f3.tar.gz
nixos-config-bb22fd61b23bd11bf4e4d0955fd873388670e0f3.zip
modules/thinkpad: Put trackpoint sensitivity settings here
-rw-r--r--hosts/tomato/hardware.nix3
-rw-r--r--modules/thinkpad.nix15
2 files changed, 15 insertions, 3 deletions
diff --git a/hosts/tomato/hardware.nix b/hosts/tomato/hardware.nix
index 0e2b9aa..86c134d 100644
--- a/hosts/tomato/hardware.nix
+++ b/hosts/tomato/hardware.nix
@@ -33,9 +33,6 @@ in
hardware.graphics.extraPackages = [pkgs.intel-vaapi-driver];
services.xserver.videoDrivers = ["intel"];
- services.udev.extraRules = ''
- ACTION=="add", SUBSYSTEM=="input", ATTR{name}=="TPPS/2 IBM TrackPoint", ATTR{device/sensitivity}="255", ATTR{device/speed}="127"
- '';
this.bluetooth.enable = true;
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 ];