6920f43f1c
* Modularised the xorg.conf generation. For instance, the Wacom and Synaptics support has been moved into separate modules. The contents of xorg.conf is defined by the option services.xserver.config, and various other options for specific sections (e.g. services.xserver.serverLayoutSection). * displayManager.job.env: made this an attribute set. * tcpEnable -> enableTCP for naming consistency. * defaultDepth can be set to 0 to leave it undefined (needed for the vmware driver). * Removed some options that seem obsolete or are now the default (e.g. RenderAccel, AllowGLXWithComposite). * Removed services.xserver.package. This can now be done using nixpkgs.config.packageOverrides. svn path=/nixos/trunk/; revision=17004
88 lines
2 KiB
Nix
88 lines
2 KiB
Nix
{ 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.linuxwacom ];
|
|
|
|
services.udev.packages = [ pkgs.linuxwacom ];
|
|
|
|
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
|
|
'';
|
|
|
|
};
|
|
|
|
}
|