From fb1e6d5c80bc09165e95bbd15eb0f109538b7ad2 Mon Sep 17 00:00:00 2001
From: Marc Weber <marco-oweber@gmx.de>
Date: Tue, 28 Apr 2009 13:49:05 +0000
Subject: [PATCH] * Synced with trunk @ 15345

svn path=/nixos/branches/modular-nixos/; revision=15372
---
 upstart-jobs/xserver/default.nix  | 13 ++++++-------
 upstart-jobs/xserver/xserver.conf | 21 +--------------------
 2 files changed, 7 insertions(+), 27 deletions(-)

diff --git a/upstart-jobs/xserver/default.nix b/upstart-jobs/xserver/default.nix
index 98fe14d19f0..a02e559ade4 100644
--- a/upstart-jobs/xserver/default.nix
+++ b/upstart-jobs/xserver/default.nix
@@ -305,15 +305,14 @@ let
   videoDriver = cfg.videoDriver;
   resolutions = map (res: ''"${toString res.x}x${toString res.y}"'') (cfg.resolutions);
 
-  videoDriverModules = getAttr [ videoDriver ] (throw "unkown video driver : \"${videoDriver}\"") knownVideoDrivers;
+  videoDriverModules = getAttr [ videoDriver ] (throw "unkown video driver : `${videoDriver}'") knownVideoDrivers;
 
   modules = 
 
     getAttr ["modulesFirst"] [] videoDriverModules
     ++ [
       xorg.xorgserver
-      xorg.xf86inputkeyboard
-      xorg.xf86inputmouse
+      xorg.xf86inputevdev
     ] 
     ++ getAttr ["modules"] [] videoDriverModules
     ++ (optional cfg.synaptics.enable ["${pkgs.synaptics}/${xorg.xorgserver}" /*xorg.xf86inputevdev*/]);
@@ -370,10 +369,10 @@ let
       Option "XkbOptions" "${cfg.xkbOptions}"
     '';
 
-    xkbModel = cfg.xkbModel;
-    layout = cfg.layout;
-
-    corePointer = if cfg.synaptics.enable then "Touchpad[0]" else "Mouse[0]";
+    setCorePointer = 
+      if cfg.synaptics.enable then ''
+        InputDevice "Touchpad[0]" "CorePointer"
+      '' else "";
 
     internalAGPGART =
       if cfg.useInternalAGPGART == "yes" then
diff --git a/upstart-jobs/xserver/xserver.conf b/upstart-jobs/xserver/xserver.conf
index 145d31e3192..a1d8aaea9b2 100644
--- a/upstart-jobs/xserver/xserver.conf
+++ b/upstart-jobs/xserver/xserver.conf
@@ -9,7 +9,6 @@ EndSection
 
 Section "ServerFlags"
   Option "AllowMouseOpenFail" "on"
-  Option "AllowEmptyInput" "off"  
 EndSection
 
 
@@ -22,23 +21,6 @@ Section "Module"
 EndSection
 
 
-Section "InputDevice"
-  Driver       "kbd"
-  Identifier   "Keyboard[0]"
-  Option       "Protocol" "Standard"
-  Option       "XkbLayout" "@layout@"
-  Option       "XkbModel" "@xkbModel@"
-  Option       "XkbRules" "xfree86"
-  @xkbOptions@
-EndSection
-
-
-Section "InputDevice"
-  Driver       "mouse"
-  Identifier   "Mouse[0]"
-  Option       "Device" "/dev/input/mice"
-EndSection
-
 @synapticsInputDevice@
 
 Section "Monitor"
@@ -89,8 +71,7 @@ EndSection
 
 Section "ServerLayout"
   Identifier   "Layout[all]"
-  InputDevice  "Keyboard[0]" "CoreKeyboard"
-  InputDevice  "@corePointer@" "CorePointer"
+  @setCorePointer@
   Screen       "Screen[0]"
   @serverLayoutOptions@
 EndSection