diff options
author | Florian Friesdorf <flo@chaoflow.net> | 2014-06-07 13:09:26 +0200 |
---|---|---|
committer | Florian Friesdorf <flo@chaoflow.net> | 2014-06-07 13:09:26 +0200 |
commit | 0136fcb3df8997a3ec89d3e072baddc66462f10c (patch) | |
tree | 6d921b2f2662d3a523ac6b861e0421f162f6e9f1 /nixos | |
parent | 36e6eda5fc21e655b172a3c8a445930bafb64e73 (diff) | |
parent | 128636ff242a7eee77cf0b6c640f184e0a2b0a1a (diff) | |
download | nixpkgs-0136fcb3df8997a3ec89d3e072baddc66462f10c.tar nixpkgs-0136fcb3df8997a3ec89d3e072baddc66462f10c.tar.gz nixpkgs-0136fcb3df8997a3ec89d3e072baddc66462f10c.tar.bz2 nixpkgs-0136fcb3df8997a3ec89d3e072baddc66462f10c.tar.lz nixpkgs-0136fcb3df8997a3ec89d3e072baddc66462f10c.tar.xz nixpkgs-0136fcb3df8997a3ec89d3e072baddc66462f10c.tar.zst nixpkgs-0136fcb3df8997a3ec89d3e072baddc66462f10c.zip |
Merge pull request #2726 from pSub/trackpoint
Added an option to configure sensitivity and speed of trackpoints.
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/module-list.nix | 1 | ||||
-rw-r--r-- | nixos/modules/tasks/trackpoint.nix | 66 |
2 files changed, 67 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 7fa705a5ae3..4ceb48989be 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -323,6 +323,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 + ''; + }; + + }; + +} |