at 15.09-beta 3.7 kB view raw
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> 64You may need to reboot after enabling this driver to prevent a clash 65with other kernel modules.</para> 66 67<para>On 64-bit systems, if you want full acceleration for 32-bit 68programs such as Wine, you should also set the following: 69<programlisting> 70hardware.opengl.driSupport32Bit = true; 71</programlisting> 72</para> 73 74</simplesect> 75 76<simplesect><title>AMD Graphics Cards</title> 77 78<para>AMD provides a proprietary driver for its graphics cards that 79has better 3D performance than the X.org drivers. It is not enabled 80by default because it’s not free software. You can enable it as follows: 81<programlisting> 82services.xserver.videoDrivers = [ "ati_unfree" ]; 83</programlisting> 84You will need to reboot after enabling this driver to prevent a clash 85with other kernel modules.</para> 86 87<para>On 64-bit systems, if you want full acceleration for 32-bit 88programs such as Wine, you should also set the following: 89<programlisting> 90hardware.opengl.driSupport32Bit = true; 91</programlisting> 92</para> 93 94</simplesect> 95 96<simplesect><title>Touchpads</title> 97 98<para>Support for Synaptics touchpads (found in many laptops such as 99the Dell Latitude series) can be enabled as follows: 100<programlisting> 101services.xserver.synaptics.enable = true; 102</programlisting> 103The driver has many options (see <xref linkend="ch-options"/>). For 104instance, the following enables two-finger scrolling: 105<programlisting> 106services.xserver.synaptics.twoFingerScroll = true; 107</programlisting> 108</para> 109 110</simplesect> 111 112 113</chapter>