Add xf86-linux-wacom.

Mostly reverts my previous commit.

svn path=/nixos/trunk/; revision=21099
This commit is contained in:
Yury G. Kudryashov 2010-04-15 15:46:38 +00:00
parent 37746e4fb3
commit 916fbfa070
3 changed files with 90 additions and 1 deletions

View File

@ -121,6 +121,7 @@
./services/x11/display-managers/kdm.nix
./services/x11/display-managers/slim.nix
./services/x11/hardware/synaptics.nix
./services/x11/hardware/wacom.nix
./services/x11/window-managers/compiz.nix
./services/x11/window-managers/default.nix
./services/x11/window-managers/icewm.nix

View File

@ -0,0 +1,88 @@
{ config, pkgs, ... }:
with pkgs.lib;
let
cfg = config.services.xserver.wacom;
in
{
options = {
services.xserver.wacom = {
enable = mkOption {
default = false;
description = "Whether to enable the Wacom touchscreen/digitizer.";
};
device = mkOption {
default = "/dev/ttyS0";
description = "Device to use.";
};
forceDeviceType = mkOption {
default = "ISDV4";
example = null;
description = "Some models (think touchscreen) require the device type to be specified.";
};
};
};
config = mkIf cfg.enable {
services.xserver.modules = [ pkgs.xf86_input_wacom ];
services.udev.packages = [ pkgs.xf86_input_wacom ];
services.xserver.serverLayoutSection =
''
InputDevice "Wacom_stylus"
InputDevice "Wacom_cursor"
InputDevice "Wacom_eraser"
'';
services.xserver.config =
''
Section "InputDevice"
Driver "wacom"
Identifier "Wacom_stylus"
Option "Device" "${cfg.device}"
Option "Type" "stylus"
${optionalString (cfg.forceDeviceType != null) ''
Option "ForceDevice" "${cfg.forceDeviceType}"
''}
Option "Button2" "3"
EndSection
Section "InputDevice"
Driver "wacom"
Identifier "Wacom_eraser"
Option "Device" "${cfg.device}"
Option "Type" "eraser"
${optionalString (cfg.forceDeviceType != null) ''
Option "ForceDevice" "${cfg.forceDeviceType}"
''}
Option "Button1" "2"
EndSection
Section "InputDevice"
Driver "wacom"
Identifier "Wacom_cursor"
Option "Device" "${cfg.device}"
Option "Type" "cursor"
${optionalString (cfg.forceDeviceType != null) ''
Option "ForceDevice" "${cfg.forceDeviceType}"
''}
EndSection
'';
};
}

View File

@ -155,7 +155,7 @@ in
modules = mkOption {
default = [];
example = [ pkgs.synaptics ];
example = [ pkgs.xf86_input_wacom ];
description = "Packages to be added to the module search path of the X server.";
};