2009-09-10 14:37:33 +02:00
|
|
|
{ config, pkgs, ... }:
|
2006-11-28 23:27:56 +01:00
|
|
|
|
2009-05-24 20:28:30 +02:00
|
|
|
with pkgs.lib;
|
|
|
|
|
2009-01-02 17:07:21 +01:00
|
|
|
let
|
2006-11-28 23:27:56 +01:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
kernelPackages = config.boot.kernelPackages;
|
2006-11-28 23:27:56 +01:00
|
|
|
|
2008-01-04 11:54:33 +01:00
|
|
|
# Abbreviations.
|
|
|
|
cfg = config.services.xserver;
|
2009-09-10 14:37:33 +02:00
|
|
|
xorg = pkgs.xorg;
|
|
|
|
|
2008-01-04 11:54:33 +01:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
# Map the video driver setting to a driver.
|
2008-10-10 18:45:56 +02:00
|
|
|
knownVideoDrivers = {
|
2009-09-10 14:37:33 +02:00
|
|
|
nvidia = { modules = [ kernelPackages.nvidia_x11 ]; };
|
2009-09-20 00:09:29 +02:00
|
|
|
nvidiaLegacy = { modules = [ kernelPackages.nvidia_x11_legacy ]; };
|
2009-09-10 14:37:33 +02:00
|
|
|
vesa = { modules = [ xorg.xf86videovesa ]; };
|
|
|
|
vga = { modules = [ xorg.xf86videovga ]; };
|
|
|
|
sis = { modules = [ xorg.xf86videosis ]; };
|
|
|
|
i810 = { modules = [ xorg.xf86videoi810 ]; };
|
|
|
|
intel = { modules = [ xorg.xf86videointel ]; };
|
|
|
|
nv = { modules = [ xorg.xf86videonv ]; };
|
|
|
|
ati = { modules = [ xorg.xf86videoati ]; };
|
|
|
|
openchrome = { modules = [ xorg.xf86videoopenchrome ]; };
|
|
|
|
cirrus = { modules = [ xorg.xf86videocirrus ]; };
|
|
|
|
vmware = { modules = [ xorg.xf86videovmware ]; };
|
2008-10-10 18:45:56 +02:00
|
|
|
};
|
|
|
|
|
2007-11-09 19:49:45 +01:00
|
|
|
videoDriver = cfg.videoDriver;
|
2007-03-06 01:07:00 +01:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
videoDriverInfo = attrByPath [videoDriver] (throw "unknown video driver: `${videoDriver}'") knownVideoDrivers;
|
2008-01-04 11:54:33 +01:00
|
|
|
|
2008-01-04 11:28:12 +01:00
|
|
|
|
2008-08-27 12:00:49 +02:00
|
|
|
fontsForXServer =
|
2009-09-10 14:37:33 +02:00
|
|
|
config.fonts.fonts ++
|
2008-08-27 12:00:49 +02:00
|
|
|
# We don't want these fonts in fonts.conf, because then modern,
|
|
|
|
# fontconfig-based applications will get horrible bitmapped
|
|
|
|
# Helvetica fonts. It's better to get a substitution (like Nimbus
|
|
|
|
# Sans) than that horror. But we do need the Adobe fonts for some
|
|
|
|
# old non-fontconfig applications. (Possibly this could be done
|
|
|
|
# better using a fontconfig rule.)
|
|
|
|
[ pkgs.xorg.fontadobe100dpi
|
|
|
|
pkgs.xorg.fontadobe75dpi
|
|
|
|
];
|
2009-06-26 01:29:49 +02:00
|
|
|
|
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
configFile = pkgs.stdenv.mkDerivation {
|
2006-11-28 23:27:56 +01:00
|
|
|
name = "xserver.conf";
|
2009-09-10 14:37:33 +02:00
|
|
|
|
|
|
|
xfs = optionalString (cfg.useXFS != false)
|
2008-01-04 11:28:12 +01:00
|
|
|
''FontPath "${toString cfg.useXFS}"'';
|
2007-12-25 13:16:38 +01:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
inherit (cfg) config;
|
|
|
|
|
|
|
|
buildCommand =
|
|
|
|
''
|
|
|
|
echo 'Section "Files"' >> $out
|
|
|
|
echo $xfs >> $out
|
|
|
|
|
|
|
|
for i in ${toString fontsForXServer}; do
|
|
|
|
if test "''${i:0:''${#NIX_STORE}}" == "$NIX_STORE"; then
|
|
|
|
for j in $(find $i -name fonts.dir); do
|
|
|
|
echo " FontPath \"$(dirname $j)\"" >> $out
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
for i in $(find ${toString cfg.modules} -type d); do
|
|
|
|
if test $(echo $i/*.so* | wc -w) -ne 0; then
|
|
|
|
echo " ModulePath \"$i\"" >> $out
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
echo 'EndSection' >> $out
|
2008-07-23 16:13:27 +02:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
echo "$config" >> $out
|
|
|
|
''; # */
|
2006-11-28 23:27:56 +01:00
|
|
|
};
|
|
|
|
|
2007-02-27 00:11:32 +01:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
halConfigFiles = singleton (pkgs.writeTextFile
|
|
|
|
{ name = "hal-policy-keymap";
|
|
|
|
destination = "/share/hal/fdi/policy/30-keymap.fdi";
|
|
|
|
text =
|
|
|
|
''
|
|
|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
|
|
<deviceinfo version="0.2">
|
|
|
|
<device>
|
|
|
|
<match key="info.capabilities" contains="input.keymap">
|
|
|
|
<append key="info.callouts.add" type="strlist">hal-setup-keymap</append>
|
|
|
|
</match>
|
|
|
|
|
|
|
|
<match key="info.capabilities" contains="input.keys">
|
|
|
|
<merge key="input.x11_options.XkbRules" type="string">base</merge>
|
|
|
|
<merge key="input.x11_options.XkbModel" type="string">${cfg.xkbModel}</merge>
|
|
|
|
<merge key="input.x11_options.XkbLayout" type="string">${cfg.layout}</merge>
|
|
|
|
<append key="input.x11_options.XkbOptions" type="strlist">${cfg.xkbOptions}</append>
|
|
|
|
</match>
|
|
|
|
</device>
|
|
|
|
</deviceinfo>
|
|
|
|
'';
|
|
|
|
});
|
2009-01-02 17:07:21 +01:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
|
2009-01-02 17:07:21 +01:00
|
|
|
in
|
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
{
|
2009-05-15 09:51:51 +02:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
imports =
|
|
|
|
[ ./display-managers/default.nix
|
|
|
|
./window-managers/default.nix
|
|
|
|
./desktop-managers/default.nix
|
|
|
|
];
|
2009-05-15 09:51:51 +02:00
|
|
|
|
2009-01-02 17:07:21 +01:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
###### interface
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
|
|
|
services.xserver = {
|
|
|
|
|
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
Whether to enable the X server.
|
|
|
|
'';
|
|
|
|
};
|
2009-01-25 16:49:08 +01:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
autorun = mkOption {
|
|
|
|
default = true;
|
|
|
|
description = ''
|
|
|
|
Whether to start the X server automatically.
|
|
|
|
'';
|
|
|
|
};
|
2009-01-02 17:07:21 +01:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
exportConfiguration = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
Whether to symlink the X server configuration under
|
|
|
|
<filename>/etc/X11/xorg.conf</filename>.
|
|
|
|
'';
|
|
|
|
};
|
2009-01-02 17:07:21 +01:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
enableTCP = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
Whether to allow the X server to accept TCP connections.
|
|
|
|
'';
|
|
|
|
};
|
2009-01-02 17:07:39 +01:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
modules = mkOption {
|
|
|
|
default = [];
|
|
|
|
example = [ pkgs.linuxwacom ];
|
|
|
|
description = "Packages to be added to the module search path of the X server.";
|
|
|
|
};
|
2009-01-02 17:07:21 +01:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
resolutions = mkOption {
|
|
|
|
default = [ {x = 1024; y = 768;} {x = 800; y = 600;} {x = 640; y = 480;} ];
|
|
|
|
description = ''
|
|
|
|
The screen resolutions for the X server. The first element is the default resolution.
|
|
|
|
'';
|
|
|
|
};
|
2009-01-02 17:07:21 +01:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
videoDriver = mkOption {
|
|
|
|
default = "vesa";
|
|
|
|
example = "i810";
|
|
|
|
description = ''
|
|
|
|
The name of the video driver for your graphics card.
|
|
|
|
'';
|
|
|
|
};
|
2009-01-02 17:07:21 +01:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
driSupport = mkOption {
|
|
|
|
default = true;
|
|
|
|
description = ''
|
|
|
|
Whether to enable accelerated OpenGL rendering through the
|
|
|
|
Direct Rendering Interface (DRI).
|
|
|
|
'';
|
|
|
|
};
|
2009-06-26 00:08:03 +02:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
startSSHAgent = mkOption {
|
|
|
|
default = true;
|
|
|
|
description = ''
|
|
|
|
Whether to start the SSH agent when you log in. The SSH agent
|
|
|
|
remembers private keys for you so that you don't have to type in
|
|
|
|
passphrases every time you make an SSH connection. Use
|
|
|
|
<command>ssh-add</command> to add a key to the agent.
|
|
|
|
'';
|
|
|
|
};
|
2009-01-02 17:07:21 +01:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
isClone = mkOption {
|
|
|
|
default = true;
|
|
|
|
example = false;
|
|
|
|
description = ''
|
|
|
|
Whether to enable the X server clone mode for dual-head.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
layout = mkOption {
|
|
|
|
default = "us";
|
|
|
|
description = ''
|
|
|
|
Keyboard layout.
|
|
|
|
'';
|
2009-01-25 16:49:08 +01:00
|
|
|
};
|
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
xkbModel = mkOption {
|
|
|
|
default = "pc104";
|
|
|
|
example = "presario";
|
|
|
|
description = ''
|
|
|
|
Keyboard model.
|
|
|
|
'';
|
|
|
|
};
|
2009-06-26 01:29:49 +02:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
xkbOptions = mkOption {
|
|
|
|
default = "";
|
|
|
|
example = "grp:caps_toggle, grp_led:scroll";
|
|
|
|
description = ''
|
|
|
|
X keyboard options; layout switching goes here.
|
|
|
|
'';
|
|
|
|
};
|
2009-01-25 16:49:08 +01:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
config = mkOption {
|
|
|
|
description = ''
|
|
|
|
The contents of the configuration file of the X server
|
|
|
|
(<filename>xorg.conf</filename>).
|
|
|
|
'';
|
|
|
|
};
|
2009-06-03 10:14:54 +02:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
deviceSection = mkOption {
|
|
|
|
default = "";
|
|
|
|
example = "VideoRAM 131072";
|
|
|
|
description = "Contents of the first Device section of the X server configuration file.";
|
|
|
|
};
|
2009-01-25 16:49:08 +01:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
monitorSection = mkOption {
|
|
|
|
default = "";
|
|
|
|
example = "HorizSync 28-49";
|
|
|
|
description = "Contents of the first Monitor section of the X server configuration file.";
|
|
|
|
};
|
2009-04-08 15:41:33 +02:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
moduleSection = mkOption {
|
|
|
|
default = "";
|
|
|
|
example =
|
|
|
|
''
|
|
|
|
SubSection "extmod"
|
|
|
|
EndSubsection
|
|
|
|
'';
|
|
|
|
description = "Contents of the Module section of the X server configuration file.";
|
|
|
|
};
|
2009-04-08 15:41:33 +02:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
serverLayoutSection = mkOption {
|
|
|
|
default = "";
|
|
|
|
example =
|
|
|
|
''
|
|
|
|
Option "AIGLX" "true"
|
|
|
|
'';
|
|
|
|
description = "Contents of the ServerLayout section of the X server configuration file.";
|
|
|
|
};
|
2009-01-25 16:49:08 +01:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
extraDisplaySettings = mkOption {
|
|
|
|
default = "";
|
|
|
|
example = "Virtual 2048 2048";
|
|
|
|
description = "Lines to be added to every Display subsection of the Screen section.";
|
|
|
|
};
|
2009-01-25 16:49:08 +01:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
defaultDepth = mkOption {
|
|
|
|
default = 24;
|
|
|
|
example = 8;
|
|
|
|
description = "Default colour depth.";
|
|
|
|
};
|
2009-01-25 16:49:08 +01:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
useXFS = mkOption {
|
|
|
|
default = false;
|
|
|
|
example = "unix/:7100";
|
|
|
|
description = "Determines how to connect to the X Font Server.";
|
|
|
|
};
|
|
|
|
|
|
|
|
tty = mkOption {
|
|
|
|
default = 7;
|
|
|
|
example = 9;
|
|
|
|
description = "Virtual console for the X server.";
|
|
|
|
};
|
|
|
|
|
|
|
|
display = mkOption {
|
|
|
|
default = 0;
|
|
|
|
example = 1;
|
|
|
|
description = "Display number for the X server.";
|
|
|
|
};
|
|
|
|
|
|
|
|
virtualScreen = mkOption {
|
|
|
|
default = null;
|
|
|
|
example = { x = 2048; y = 2048; };
|
|
|
|
description = ''
|
|
|
|
Virtual screen size for Xrandr.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
environment.x11Packages = mkOption {
|
|
|
|
default = [];
|
|
|
|
type = types.list types.package;
|
|
|
|
description = ''
|
|
|
|
List of packages added to the system when the X server is
|
|
|
|
activated (<option>services.xserver.enable</option>).
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
|
|
|
|
assertions = singleton
|
|
|
|
{ assertion = config.services.hal.enable == true;
|
|
|
|
message = "The X server needs HAL running. Set services.hal.enable to true";
|
|
|
|
};
|
|
|
|
|
|
|
|
boot.extraModulePackages =
|
2009-09-20 00:09:29 +02:00
|
|
|
optional (cfg.videoDriver == "nvidia") kernelPackages.nvidia_x11 ++
|
|
|
|
optional (cfg.videoDriver == "nvidiaLegacy") kernelPackages.nvidia_x11_legacy;
|
2009-09-10 14:37:33 +02:00
|
|
|
|
|
|
|
environment.etc = optionals cfg.exportConfiguration
|
|
|
|
[ { source = "${configFile}";
|
|
|
|
target = "X11/xorg.conf";
|
|
|
|
}
|
|
|
|
# -xkbdir command line option does not seems to be passed to xkbcomp.
|
|
|
|
{ source = "${pkgs.xkeyboard_config}/etc/X11/xkb";
|
|
|
|
target = "X11/xkb";
|
2009-01-25 16:49:08 +01:00
|
|
|
}
|
2009-09-10 14:37:33 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
environment.x11Packages =
|
|
|
|
[ xorg.xorgserver
|
|
|
|
xorg.xrandr
|
|
|
|
xorg.xrdb
|
|
|
|
xorg.setxkbmap
|
|
|
|
xorg.iceauth # required for KDE applications (it's called by dcopserver)
|
|
|
|
xorg.xsetroot
|
2009-09-13 15:26:35 +02:00
|
|
|
xorg.xprop
|
2009-09-10 14:37:33 +02:00
|
|
|
]
|
2009-09-20 00:09:29 +02:00
|
|
|
++ optional (videoDriver == "nvidia") kernelPackages.nvidia_x11
|
|
|
|
++ optional (videoDriver == "nvidiaLegacy") kernelPackages.nvidia_x11_legacy;
|
2009-09-10 14:37:33 +02:00
|
|
|
|
|
|
|
environment.systemPackages = config.environment.x11Packages;
|
|
|
|
|
|
|
|
services.hal.packages = halConfigFiles;
|
|
|
|
|
2009-10-12 20:09:34 +02:00
|
|
|
jobs.xserver =
|
2009-10-12 19:27:57 +02:00
|
|
|
{ startOn = if cfg.autorun then "hal" else "never";
|
2009-09-10 14:37:33 +02:00
|
|
|
|
|
|
|
environment =
|
|
|
|
{ FONTCONFIG_FILE = "/etc/fonts/fonts.conf"; # !!! cleanup
|
|
|
|
XKB_BINDIR = "${xorg.xkbcomp}/bin"; # Needed for the Xkb extension.
|
|
|
|
} // optionalAttrs (videoDriver != "nvidia") {
|
|
|
|
XORG_DRI_DRIVER_PATH = "${pkgs.mesa}/lib/dri";
|
|
|
|
} // optionalAttrs (videoDriver == "nvidia") {
|
|
|
|
LD_LIBRARY_PATH = "${xorg.libX11}/lib:${xorg.libXext}/lib:${kernelPackages.nvidia_x11}/lib";
|
2009-09-20 00:09:29 +02:00
|
|
|
} // optionalAttrs (videoDriver == "nvidiaLegacy") {
|
|
|
|
LD_LIBRARY_PATH = "${xorg.libX11}/lib:${xorg.libXext}/lib:${kernelPackages.nvidia_x11_legacy}/lib";
|
2009-09-10 14:37:33 +02:00
|
|
|
} // cfg.displayManager.job.environment;
|
|
|
|
|
|
|
|
preStart =
|
|
|
|
''
|
|
|
|
# Ugly hack: wait until udev has started since the X server
|
|
|
|
# needs various devices. This would more properly be
|
|
|
|
# expressed as an Upstart dependency, but AFAIK in "start
|
|
|
|
# on" we can't express a logical AND.
|
|
|
|
while ! initctl status udev 2>&1 | grep -q running; do
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
|
|
|
|
rm -f /var/run/opengl-driver
|
|
|
|
${if videoDriver == "nvidia"
|
|
|
|
then ''
|
|
|
|
ln -sf ${kernelPackages.nvidia_x11} /var/run/opengl-driver
|
|
|
|
''
|
2009-09-20 00:09:29 +02:00
|
|
|
else if videoDriver == "nvidia"
|
|
|
|
then ''
|
|
|
|
ln -sf ${kernelPackages.nvidia_x11_legacy} /var/run/opengl-driver
|
|
|
|
''
|
2009-09-10 14:37:33 +02:00
|
|
|
else if cfg.driSupport
|
|
|
|
then "ln -sf ${pkgs.mesa} /var/run/opengl-driver"
|
|
|
|
else ""
|
|
|
|
}
|
|
|
|
|
2009-09-10 17:49:16 +02:00
|
|
|
${cfg.displayManager.job.preStart}
|
2009-09-10 14:37:33 +02:00
|
|
|
|
|
|
|
rm -f /tmp/.X0-lock
|
|
|
|
'';
|
|
|
|
|
2009-09-13 17:03:07 +02:00
|
|
|
script = "${cfg.displayManager.job.execCmd}";
|
2009-09-10 14:37:33 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
services.xserver.displayManager.xserverArgs =
|
|
|
|
[ "-ac"
|
|
|
|
"-logverbose"
|
|
|
|
"-verbose"
|
|
|
|
"-terminate"
|
|
|
|
"-logfile" "/var/log/X.${toString cfg.display}.log"
|
|
|
|
"-config ${configFile}"
|
|
|
|
":${toString cfg.display}" "vt${toString cfg.tty}"
|
|
|
|
"-xkbdir" "${pkgs.xkeyboard_config}/etc/X11/xkb"
|
|
|
|
] ++ optional (!cfg.enableTCP) "-nolisten tcp";
|
|
|
|
|
|
|
|
services.xserver.modules = videoDriverInfo.modules
|
|
|
|
++ [ xorg.xorgserver xorg.xf86inputevdev ];
|
|
|
|
|
|
|
|
services.xserver.config =
|
|
|
|
''
|
|
|
|
Section "ServerFlags"
|
|
|
|
Option "AllowMouseOpenFail" "on"
|
|
|
|
EndSection
|
|
|
|
|
|
|
|
Section "Module"
|
|
|
|
${cfg.moduleSection}
|
|
|
|
EndSection
|
|
|
|
|
|
|
|
Section "Monitor"
|
|
|
|
${cfg.monitorSection}
|
|
|
|
EndSection
|
|
|
|
|
|
|
|
Section "Device"
|
|
|
|
${cfg.deviceSection}
|
|
|
|
EndSection
|
|
|
|
|
|
|
|
Section "ServerLayout"
|
|
|
|
${cfg.serverLayoutSection}
|
|
|
|
EndSection
|
|
|
|
|
|
|
|
Section "Screen"
|
|
|
|
Identifier "Screen[0]"
|
|
|
|
Device "Device[0]"
|
|
|
|
Monitor "Monitor[0]"
|
|
|
|
|
|
|
|
${optionalString (cfg.defaultDepth != 0) ''
|
|
|
|
DefaultDepth ${toString cfg.defaultDepth}
|
|
|
|
''}
|
|
|
|
|
|
|
|
${optionalString (cfg.videoDriver == "nvidia") ''
|
|
|
|
Option "RandRRotation" "on"
|
|
|
|
''}
|
|
|
|
|
|
|
|
${
|
|
|
|
let
|
|
|
|
f = depth:
|
|
|
|
''
|
|
|
|
SubSection "Display"
|
|
|
|
Depth ${toString depth}
|
|
|
|
Modes ${concatMapStrings (res: ''"${toString res.x}x${toString res.y}"'') cfg.resolutions}
|
|
|
|
${cfg.extraDisplaySettings}
|
|
|
|
${optionalString (cfg.virtualScreen != null)
|
|
|
|
"Virtual ${toString cfg.virtualScreen.x} ${toString cfg.virtualScreen.y}"}
|
|
|
|
EndSubSection
|
|
|
|
'';
|
|
|
|
in concatMapStrings f [8 16 24]
|
|
|
|
}
|
|
|
|
|
|
|
|
EndSection
|
|
|
|
|
|
|
|
Section "Extensions"
|
2009-09-20 00:09:29 +02:00
|
|
|
${optionalString (cfg.videoDriver == "nvidia" || cfg.videoDriver == "nvidiaLegacy" || cfg.videoDriver == "i810" || cfg.videoDriver == "ati" || cfg.videoDriver == "radeonhd") ''
|
2009-09-10 14:37:33 +02:00
|
|
|
Option "Composite" "Enable"
|
|
|
|
''}
|
|
|
|
EndSection
|
|
|
|
|
|
|
|
Section "DRI"
|
|
|
|
Mode 0666 # !!! FIX THIS!
|
|
|
|
EndSection
|
|
|
|
'';
|
2009-01-25 16:49:08 +01:00
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
services.xserver.monitorSection =
|
|
|
|
''
|
|
|
|
Identifier "Monitor[0]"
|
2009-01-25 16:49:08 +01:00
|
|
|
'';
|
2009-09-10 14:37:33 +02:00
|
|
|
|
|
|
|
services.xserver.deviceSection =
|
|
|
|
''
|
|
|
|
Identifier "Device[0]"
|
2009-09-20 00:09:29 +02:00
|
|
|
Driver "${if cfg.videoDriver == "nvidiaLegacy" then "nvidia" else cfg.videoDriver}"
|
2009-09-10 14:37:33 +02:00
|
|
|
|
|
|
|
# !!! Is the "Clone" option still useful?
|
|
|
|
Option "Clone" "${if cfg.isClone then "on" else "off"}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
services.xserver.serverLayoutSection =
|
|
|
|
''
|
|
|
|
Identifier "Layout[all]"
|
|
|
|
Screen "Screen[0]"
|
|
|
|
'';
|
|
|
|
|
2009-01-02 17:07:21 +01:00
|
|
|
};
|
2009-09-10 14:37:33 +02:00
|
|
|
|
2006-11-28 23:27:56 +01:00
|
|
|
}
|