2007-02-25 17:20:14 +01:00
|
|
|
{ stdenv, writeText
|
2007-02-25 16:53:57 +01:00
|
|
|
|
|
|
|
, lib
|
2006-11-28 23:27:56 +01:00
|
|
|
|
|
|
|
, xorgserver
|
|
|
|
|
2007-02-25 17:20:14 +01:00
|
|
|
, xinit
|
|
|
|
|
|
|
|
, # Initial client/window manager.
|
|
|
|
twm, xterm
|
|
|
|
|
2006-11-28 23:27:56 +01:00
|
|
|
, xf86inputkeyboard
|
|
|
|
|
|
|
|
, xf86inputmouse
|
|
|
|
|
|
|
|
, xf86videovesa
|
|
|
|
|
|
|
|
, # Virtual console for the X server.
|
|
|
|
tty ? 7
|
|
|
|
|
|
|
|
, # X display number.
|
|
|
|
display ? 0
|
|
|
|
|
2007-02-25 16:53:57 +01:00
|
|
|
, # List of font directories.
|
|
|
|
fontDirectories
|
|
|
|
|
2006-11-28 23:27:56 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
|
2007-02-25 16:53:57 +01:00
|
|
|
config = stdenv.mkDerivation {
|
2006-11-28 23:27:56 +01:00
|
|
|
name = "xserver.conf";
|
|
|
|
src = ./xserver.conf;
|
2007-02-25 16:53:57 +01:00
|
|
|
inherit fontDirectories;
|
|
|
|
buildCommand = "
|
|
|
|
buildCommand= # urgh, don't substitute this
|
|
|
|
export fontPaths=
|
|
|
|
for i in $fontDirectories; do
|
|
|
|
if test \"\${i:0:\${#NIX_STORE}}\" == \"$NIX_STORE\"; then
|
|
|
|
for j in $(find $i -name fonts.dir); do
|
|
|
|
fontPaths=\"\${fontPaths}FontPath \\\"$(dirname $j)\\\"\\n\"
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
substituteAll $src $out
|
|
|
|
";
|
2006-11-28 23:27:56 +01:00
|
|
|
};
|
|
|
|
|
2007-02-25 17:20:14 +01:00
|
|
|
clientScript = writeText "xclient" "
|
|
|
|
${twm}/bin/twm &
|
|
|
|
${xterm}/bin/xterm -ls
|
|
|
|
";
|
|
|
|
|
2006-11-28 23:27:56 +01:00
|
|
|
in
|
|
|
|
|
|
|
|
rec {
|
|
|
|
name = "xserver";
|
|
|
|
|
|
|
|
job = "
|
2006-11-29 23:34:59 +01:00
|
|
|
#start on network-interfaces
|
2006-11-28 23:27:56 +01:00
|
|
|
|
|
|
|
start script
|
|
|
|
|
|
|
|
end script
|
|
|
|
|
|
|
|
# !!! -ac is a bad idea.
|
2007-02-25 17:20:14 +01:00
|
|
|
exec ${xinit}/bin/xinit ${stdenv.bash}/bin/sh ${clientScript} -- ${xorgserver}/bin/X \\
|
2006-11-28 23:27:56 +01:00
|
|
|
-ac -nolisten tcp -terminate \\
|
|
|
|
-logfile /var/log/X.${toString display}.log \\
|
|
|
|
-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}
|
|
|
|
";
|
|
|
|
|
|
|
|
}
|