summary refs log tree commit diff
diff options
context:
space:
mode:
authorPascal Wittmann <mail@pascal-wittmann.de>2014-05-23 10:18:03 +0200
committerPascal Wittmann <mail@pascal-wittmann.de>2014-05-23 10:18:03 +0200
commit128636ff242a7eee77cf0b6c640f184e0a2b0a1a (patch)
tree054d9521e58eaa88d7eb7553ae85988d0d312021
parent3a9917bf1856a85dbee3332dd32f2884a8320cc1 (diff)
downloadnixpkgs-128636ff242a7eee77cf0b6c640f184e0a2b0a1a.tar
nixpkgs-128636ff242a7eee77cf0b6c640f184e0a2b0a1a.tar.gz
nixpkgs-128636ff242a7eee77cf0b6c640f184e0a2b0a1a.tar.bz2
nixpkgs-128636ff242a7eee77cf0b6c640f184e0a2b0a1a.tar.lz
nixpkgs-128636ff242a7eee77cf0b6c640f184e0a2b0a1a.tar.xz
nixpkgs-128636ff242a7eee77cf0b6c640f184e0a2b0a1a.tar.zst
nixpkgs-128636ff242a7eee77cf0b6c640f184e0a2b0a1a.zip
Added an option to configure sensitivity and speed of trackpoints.
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/tasks/trackpoint.nix66
2 files changed, 67 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index f98b621111f..a7f121bc7c2 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -317,6 +317,7 @@
   ./tasks/network-interfaces.nix
   ./tasks/scsi-link-power-management.nix
   ./tasks/swraid.nix
+  ./tasks/trackpoint.nix
   ./testing/service-runner.nix
   ./virtualisation/container-config.nix
   ./virtualisation/containers.nix
diff --git a/nixos/modules/tasks/trackpoint.nix b/nixos/modules/tasks/trackpoint.nix
new file mode 100644
index 00000000000..4be2c3eb4c4
--- /dev/null
+++ b/nixos/modules/tasks/trackpoint.nix
@@ -0,0 +1,66 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+{
+  ###### interface
+
+  options = {
+
+    hardware.trackpoint = {
+
+      enable = mkOption {
+        default = false;
+        type = types.bool;
+        description = ''
+          Enable sensitivity and speed configuration for trackpoints.
+        '';
+      };
+  
+      sensitivity = mkOption {
+        default = 128;
+        example = 255;
+        type = types.int;
+        description = ''
+          Configure the trackpoint sensitivity. By default, the kernel
+          configures 128.
+        '';
+      };
+
+      speed = mkOption {
+        default = 97;
+        example = 255;
+        type = types.int;
+        description = ''
+          Configure the trackpoint sensitivity. By default, the kernel
+          configures 97.
+        '';
+      };
+      
+    };
+
+  };
+
+
+  ###### implementation
+
+  config = mkIf config.hardware.trackpoint.enable {
+
+    jobs.trackpoint =
+      { description = "Initialize trackpoint";
+
+        startOn = "started udev";
+
+        task = true;
+
+        script = ''
+          echo -n ${toString config.hardware.trackpoint.sensitivity} \
+            > /sys/devices/platform/i8042/serio1/sensitivity
+          echo -n ${toString config.hardware.trackpoint.speed} \
+            > /sys/devices/platform/i8042/serio1/speed
+        '';
+      };
+         
+  };
+
+}