summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 ];