From 057f01b11ecc8c2a9ea1c3139293dbe2eeec3951 Mon Sep 17 00:00:00 2001 From: Daniel Ehlers Date: Sun, 12 Apr 2015 23:49:48 +0200 Subject: services.x11: Add option for additional InputClass sections. Implement support for additional InputClass sections, e.g. for non keyboard input devices. --- nixos/modules/services/x11/xserver.nix | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'nixos') diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix index 64e0d4d8050e..9be7bffaac10 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -147,6 +147,19 @@ in ''; }; + inputClassSections = mkOption { + type = types.listOf types.lines; + default = []; + example = [ '' + Identifier "Trackpoint Wheel Emulation" + MatchProduct "ThinkPad USB Keyboard with TrackPoint" + Option "EmulateWheel" "true + Option "EmulateWheelButton" "2" + Option "Emulate3Buttons" "false" + '' ]; + description = "Content of additional InputClass sections of the X server configuration file."; + }; + modules = mkOption { type = types.listOf types.path; default = []; @@ -522,6 +535,14 @@ in Option "XkbVariant" "${cfg.xkbVariant}" EndSection + # Additional "InputClass" sections + ${flip concatMapStrings cfg.inputClassSections (inputClassSection: '' + Section "InputClass" + ${inputClassSection} + EndSection + '')} + + Section "ServerLayout" Identifier "Layout[all]" ${cfg.serverLayoutSection} -- cgit 1.4.1