1<chapter xmlns="http://docbook.org/ns/docbook"
2 xmlns:xlink="http://www.w3.org/1999/xlink"
3 xmlns:xi="http://www.w3.org/2001/XInclude"
4 version="5.0"
5 xml:id="sec-x11">
6
7<title>X Window System</title>
8
9<para>The X Window System (X11) provides the basis of NixOS’ graphical
10user interface. It can be enabled as follows:
11<programlisting>
12services.xserver.enable = true;
13</programlisting>
14The X server will automatically detect and use the appropriate video
15driver from a set of X.org drivers (such as <literal>vesa</literal>
16and <literal>intel</literal>). You can also specify a driver
17manually, e.g.
18<programlisting>
19services.xserver.videoDrivers = [ "r128" ];
20</programlisting>
21to enable X.org’s <literal>xf86-video-r128</literal> driver.</para>
22
23<para>You also need to enable at least one desktop or window manager.
24Otherwise, you can only log into a plain undecorated
25<command>xterm</command> window. Thus you should pick one or more of
26the following lines:
27<programlisting>
28services.xserver.desktopManager.kde4.enable = true;
29services.xserver.desktopManager.xfce.enable = true;
30services.xserver.windowManager.xmonad.enable = true;
31services.xserver.windowManager.twm.enable = true;
32services.xserver.windowManager.icewm.enable = true;
33</programlisting>
34</para>
35
36<para>NixOS’s default <emphasis>display manager</emphasis> (the
37program that provides a graphical login prompt and manages the X
38server) is SLiM. You can select KDE’s <command>kdm</command> instead:
39<programlisting>
40services.xserver.displayManager.kdm.enable = true;
41</programlisting>
42</para>
43
44<para>The X server is started automatically at boot time. If you
45don’t want this to happen, you can set:
46<programlisting>
47services.xserver.autorun = false;
48</programlisting>
49The X server can then be started manually:
50<screen>
51# systemctl start display-manager.service
52</screen>
53</para>
54
55
56<simplesect><title>NVIDIA Graphics Cards</title>
57
58<para>NVIDIA provides a proprietary driver for its graphics cards that
59has better 3D performance than the X.org drivers. It is not enabled
60by default because it’s not free software. You can enable it as follows:
61<programlisting>
62services.xserver.videoDrivers = [ "nvidia" ];
63</programlisting>
64Or if you have an older card, you may have to use one of the legacy drivers:
65<programlisting>
66services.xserver.videoDrivers = [ "nvidiaLegacy340" ];
67services.xserver.videoDrivers = [ "nvidiaLegacy304" ];
68services.xserver.videoDrivers = [ "nvidiaLegacy173" ];
69</programlisting>
70You may need to reboot after enabling this driver to prevent a clash
71with other kernel modules.</para>
72
73<para>On 64-bit systems, if you want full acceleration for 32-bit
74programs such as Wine, you should also set the following:
75<programlisting>
76hardware.opengl.driSupport32Bit = true;
77</programlisting>
78</para>
79
80</simplesect>
81
82<simplesect><title>AMD Graphics Cards</title>
83
84<para>AMD provides a proprietary driver for its graphics cards that
85has better 3D performance than the X.org drivers. It is not enabled
86by default because it’s not free software. You can enable it as follows:
87<programlisting>
88services.xserver.videoDrivers = [ "ati_unfree" ];
89</programlisting>
90You will need to reboot after enabling this driver to prevent a clash
91with other kernel modules.</para>
92
93<para>On 64-bit systems, if you want full acceleration for 32-bit
94programs such as Wine, you should also set the following:
95<programlisting>
96hardware.opengl.driSupport32Bit = true;
97</programlisting>
98</para>
99
100</simplesect>
101
102<simplesect><title>Touchpads</title>
103
104<para>Support for Synaptics touchpads (found in many laptops such as
105the Dell Latitude series) can be enabled as follows:
106<programlisting>
107services.xserver.synaptics.enable = true;
108</programlisting>
109The driver has many options (see <xref linkend="ch-options"/>). For
110instance, the following enables two-finger scrolling:
111<programlisting>
112services.xserver.synaptics.twoFingerScroll = true;
113</programlisting>
114</para>
115
116</simplesect>
117
118<simplesect><title>GTK/Qt themes</title>
119
120<para>GTK themes can be installed either to user profile or system-wide (via
121<literal>system.environmentPackages</literal>). To make Qt 5 applications look similar
122to GTK2 ones, you can install <literal>qt5.qtbase.gtk</literal> package into your
123system environment. It should work for all Qt 5 library versions.
124</para>
125
126</simplesect>
127
128</chapter>