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