* Add the X server as an Upstart service. The X server is pure,

except for the fonts, which are still hardcoded.  The current
  configuration uses the VESA driver, which should work on most
  machines.  Of course, the configuration should now be generated from
  a higher-level specification.

svn path=/nixos/trunk/; revision=7165
This commit is contained in:
Eelco Dolstra 2006-11-28 22:27:56 +00:00
parent a66bae7b2f
commit 8532f2be8e
4 changed files with 125 additions and 0 deletions

View File

@ -135,6 +135,12 @@ rec {
inherit (pkgs) openssh;
})
# X server.
(import ../upstart-jobs/xserver.nix {
inherit (pkgs) genericSubstituter;
inherit (pkgs.xorg) xorgserver xf86inputkeyboard xf86inputmouse xf86videovesa;
})
# Transparent TTY backgrounds.
(import ../upstart-jobs/tty-backgrounds.nix {
inherit (pkgs) stdenv splashutils;

View File

@ -31,6 +31,8 @@ with bootEnv;
rec {
inherit upstartJobs;
systemConfiguration = pkgs.stdenv.mkDerivation {
name = "system-configuration";

68
upstart-jobs/xserver.conf Normal file
View File

@ -0,0 +1,68 @@
Section "Files"
EndSection
Section "ServerFlags"
Option "AllowMouseOpenFail" "on"
Option "DontVTSwitch" "off"
EndSection
Section "Module"
EndSection
Section "InputDevice"
Driver "kbd"
Identifier "Keyboard[0]"
Option "Protocol" "Standard"
Option "XkbLayout" "us"
Option "XkbModel" "pc104"
Option "XkbRules" "xfree86"
EndSection
Section "InputDevice"
Driver "mouse"
Identifier "Mouse[0]"
Option "Device" "/dev/mice"
EndSection
Section "Monitor"
Identifier "Monitor[0]"
Option "DPMS"
UseModes "Modes[0]"
EndSection
Section "Modes"
Identifier "Modes[0]"
EndSection
Section "Screen"
Identifier "Screen[0]"
Device "Device[0]"
Monitor "Monitor[0]"
DefaultDepth 16
SubSection "Display"
Depth 16
Modes "1024x768"
EndSubSection
EndSection
Section "Device"
Identifier "Device[0]"
Driver "vesa"
EndSection
Section "ServerLayout"
Identifier "Layout[all]"
InputDevice "Keyboard[0]" "CoreKeyboard"
InputDevice "Mouse[0]" "CorePointer"
Screen "Screen[0]"
EndSection

49
upstart-jobs/xserver.nix Normal file
View File

@ -0,0 +1,49 @@
{ genericSubstituter
, xorgserver
, xf86inputkeyboard
, xf86inputmouse
, xf86videovesa
, # Virtual console for the X server.
tty ? 7
, # X display number.
display ? 0
}:
let
config = genericSubstituter {
name = "xserver.conf";
src = ./xserver.conf;
};
in
rec {
name = "xserver";
job = "
start on network-interfaces
start script
end script
# !!! -ac is a bad idea.
exec ${xorgserver}/bin/X \\
-ac -nolisten tcp -terminate \\
-logfile /var/log/X.${toString display}.log \\
-fp /var/fonts \\
-modulepath ${xorgserver}/lib/xorg/modules,${xf86inputkeyboard}/lib/xorg/modules/input,${xf86inputmouse}/lib/xorg/modules/input,${xf86videovesa}/lib/xorg/modules/drivers \\
-config ${config} \\
:${toString display} vt${toString tty}
";
}