2014-08-24 18:18:18 +01:00
|
|
|
|
<chapter xmlns="http://docbook.org/ns/docbook"
|
|
|
|
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
|
|
|
xmlns:xi="http://www.w3.org/2001/XInclude"
|
|
|
|
|
version="5.0"
|
|
|
|
|
xml:id="sec-x11">
|
2018-05-02 00:57:09 +01:00
|
|
|
|
<title>X Window System</title>
|
|
|
|
|
<para>
|
|
|
|
|
The X Window System (X11) provides the basis of NixOS’ graphical user
|
|
|
|
|
interface. It can be enabled as follows:
|
2014-08-24 18:18:18 +01:00
|
|
|
|
<programlisting>
|
2018-04-05 09:43:56 +01:00
|
|
|
|
<xref linkend="opt-services.xserver.enable"/> = true;
|
2014-08-24 18:18:18 +01:00
|
|
|
|
</programlisting>
|
2018-05-02 00:57:09 +01:00
|
|
|
|
The X server will automatically detect and use the appropriate video driver
|
|
|
|
|
from a set of X.org drivers (such as <literal>vesa</literal> and
|
|
|
|
|
<literal>intel</literal>). You can also specify a driver manually, e.g.
|
2014-08-24 18:18:18 +01:00
|
|
|
|
<programlisting>
|
2018-04-05 09:43:56 +01:00
|
|
|
|
<xref linkend="opt-services.xserver.videoDrivers"/> = [ "r128" ];
|
2014-08-24 18:18:18 +01:00
|
|
|
|
</programlisting>
|
2018-05-02 00:57:09 +01:00
|
|
|
|
to enable X.org’s <literal>xf86-video-r128</literal> driver.
|
|
|
|
|
</para>
|
|
|
|
|
<para>
|
|
|
|
|
You also need to enable at least one desktop or window manager. Otherwise,
|
|
|
|
|
you can only log into a plain undecorated <command>xterm</command> window.
|
|
|
|
|
Thus you should pick one or more of the following lines:
|
2014-08-24 18:18:18 +01:00
|
|
|
|
<programlisting>
|
2018-04-05 09:43:56 +01:00
|
|
|
|
<xref linkend="opt-services.xserver.desktopManager.plasma5.enable"/> = true;
|
|
|
|
|
<xref linkend="opt-services.xserver.desktopManager.xfce.enable"/> = true;
|
|
|
|
|
<xref linkend="opt-services.xserver.desktopManager.gnome3.enable"/> = true;
|
2018-08-04 07:23:54 +01:00
|
|
|
|
<xref linkend="opt-services.xserver.desktopManager.mate.enable"/> = true;
|
2018-04-05 09:43:56 +01:00
|
|
|
|
<xref linkend="opt-services.xserver.windowManager.xmonad.enable"/> = true;
|
|
|
|
|
<xref linkend="opt-services.xserver.windowManager.twm.enable"/> = true;
|
|
|
|
|
<xref linkend="opt-services.xserver.windowManager.icewm.enable"/> = true;
|
|
|
|
|
<xref linkend="opt-services.xserver.windowManager.i3.enable"/> = true;
|
2014-08-24 18:18:18 +01:00
|
|
|
|
</programlisting>
|
2018-05-02 00:57:09 +01:00
|
|
|
|
</para>
|
|
|
|
|
<para>
|
|
|
|
|
NixOS’s default <emphasis>display manager</emphasis> (the program that
|
2019-01-18 17:11:00 +00:00
|
|
|
|
provides a graphical login prompt and manages the X server) is LightDM. You can
|
2018-05-02 00:57:09 +01:00
|
|
|
|
select an alternative one by picking one of the following lines:
|
2014-08-24 18:18:18 +01:00
|
|
|
|
<programlisting>
|
2018-04-05 09:43:56 +01:00
|
|
|
|
<xref linkend="opt-services.xserver.displayManager.sddm.enable"/> = true;
|
2019-01-18 17:11:00 +00:00
|
|
|
|
<xref linkend="opt-services.xserver.displayManager.slim.enable"/> = true;
|
2014-08-24 18:18:18 +01:00
|
|
|
|
</programlisting>
|
2018-05-02 00:57:09 +01:00
|
|
|
|
</para>
|
|
|
|
|
<para>
|
|
|
|
|
You can set the keyboard layout (and optionally the layout variant):
|
2017-06-17 20:37:25 +01:00
|
|
|
|
<programlisting>
|
2018-04-05 09:43:56 +01:00
|
|
|
|
<xref linkend="opt-services.xserver.layout"/> = "de";
|
|
|
|
|
<xref linkend="opt-services.xserver.xkbVariant"/> = "neo";
|
2017-06-17 20:37:25 +01:00
|
|
|
|
</programlisting>
|
2018-05-02 00:57:09 +01:00
|
|
|
|
</para>
|
|
|
|
|
<para>
|
|
|
|
|
The X server is started automatically at boot time. If you don’t want this
|
|
|
|
|
to happen, you can set:
|
2014-08-24 18:18:18 +01:00
|
|
|
|
<programlisting>
|
2018-04-05 09:43:56 +01:00
|
|
|
|
<xref linkend="opt-services.xserver.autorun"/> = false;
|
2014-08-24 18:18:18 +01:00
|
|
|
|
</programlisting>
|
2018-05-02 00:57:09 +01:00
|
|
|
|
The X server can then be started manually:
|
2014-08-24 18:18:18 +01:00
|
|
|
|
<screen>
|
2016-06-01 15:23:32 +01:00
|
|
|
|
# systemctl start display-manager.service
|
2014-08-24 18:18:18 +01:00
|
|
|
|
</screen>
|
2018-05-02 00:57:09 +01:00
|
|
|
|
</para>
|
2018-09-02 20:45:04 +01:00
|
|
|
|
<simplesect xml:id="sec-x11-graphics-cards-nvidia">
|
2018-05-02 00:57:09 +01:00
|
|
|
|
<title>NVIDIA Graphics Cards</title>
|
|
|
|
|
<para>
|
|
|
|
|
NVIDIA provides a proprietary driver for its graphics cards that has better
|
|
|
|
|
3D performance than the X.org drivers. It is not enabled by default because
|
|
|
|
|
it’s not free software. You can enable it as follows:
|
2014-08-24 18:18:18 +01:00
|
|
|
|
<programlisting>
|
2018-04-05 09:43:56 +01:00
|
|
|
|
<xref linkend="opt-services.xserver.videoDrivers"/> = [ "nvidia" ];
|
2014-08-24 18:18:18 +01:00
|
|
|
|
</programlisting>
|
2018-05-02 00:57:09 +01:00
|
|
|
|
Or if you have an older card, you may have to use one of the legacy drivers:
|
2015-09-02 12:18:09 +01:00
|
|
|
|
<programlisting>
|
2018-04-05 09:43:56 +01:00
|
|
|
|
<xref linkend="opt-services.xserver.videoDrivers"/> = [ "nvidiaLegacy340" ];
|
|
|
|
|
<xref linkend="opt-services.xserver.videoDrivers"/> = [ "nvidiaLegacy304" ];
|
|
|
|
|
<xref linkend="opt-services.xserver.videoDrivers"/> = [ "nvidiaLegacy173" ];
|
2015-09-02 12:18:09 +01:00
|
|
|
|
</programlisting>
|
2018-05-02 00:57:09 +01:00
|
|
|
|
You may need to reboot after enabling this driver to prevent a clash with
|
|
|
|
|
other kernel modules.
|
|
|
|
|
</para>
|
|
|
|
|
<para>
|
|
|
|
|
On 64-bit systems, if you want full acceleration for 32-bit programs such as
|
|
|
|
|
Wine, you should also set the following:
|
2014-08-24 18:18:18 +01:00
|
|
|
|
<programlisting>
|
2018-04-05 09:43:56 +01:00
|
|
|
|
<xref linkend="opt-hardware.opengl.driSupport32Bit"/> = true;
|
2014-08-24 18:18:18 +01:00
|
|
|
|
</programlisting>
|
2018-05-02 00:57:09 +01:00
|
|
|
|
</para>
|
|
|
|
|
</simplesect>
|
2018-09-02 20:45:04 +01:00
|
|
|
|
<simplesect xml:id="sec-x11--graphics-cards-amd">
|
2018-05-02 00:57:09 +01:00
|
|
|
|
<title>AMD Graphics Cards</title>
|
|
|
|
|
<para>
|
|
|
|
|
AMD provides a proprietary driver for its graphics cards that has better 3D
|
|
|
|
|
performance than the X.org drivers. It is not enabled by default because
|
|
|
|
|
it’s not free software. You can enable it as follows:
|
2014-09-07 03:42:32 +01:00
|
|
|
|
<programlisting>
|
2018-04-05 09:43:56 +01:00
|
|
|
|
<xref linkend="opt-services.xserver.videoDrivers"/> = [ "ati_unfree" ];
|
2014-09-07 03:42:32 +01:00
|
|
|
|
</programlisting>
|
2018-05-02 00:57:09 +01:00
|
|
|
|
You will need to reboot after enabling this driver to prevent a clash with
|
|
|
|
|
other kernel modules.
|
|
|
|
|
</para>
|
|
|
|
|
<para>
|
|
|
|
|
On 64-bit systems, if you want full acceleration for 32-bit programs such as
|
|
|
|
|
Wine, you should also set the following:
|
2014-09-07 03:42:32 +01:00
|
|
|
|
<programlisting>
|
2018-04-05 09:43:56 +01:00
|
|
|
|
<xref linkend="opt-hardware.opengl.driSupport32Bit"/> = true;
|
2014-09-07 03:42:32 +01:00
|
|
|
|
</programlisting>
|
2018-05-02 00:57:09 +01:00
|
|
|
|
</para>
|
|
|
|
|
</simplesect>
|
2018-09-02 20:45:04 +01:00
|
|
|
|
<simplesect xml:id="sec-x11-touchpads">
|
2018-05-02 00:57:09 +01:00
|
|
|
|
<title>Touchpads</title>
|
|
|
|
|
<para>
|
|
|
|
|
Support for Synaptics touchpads (found in many laptops such as the Dell
|
|
|
|
|
Latitude series) can be enabled as follows:
|
2014-08-24 18:18:18 +01:00
|
|
|
|
<programlisting>
|
2018-04-05 09:43:56 +01:00
|
|
|
|
<xref linkend="opt-services.xserver.libinput.enable"/> = true;
|
2014-08-24 18:18:18 +01:00
|
|
|
|
</programlisting>
|
2018-05-02 00:57:09 +01:00
|
|
|
|
The driver has many options (see <xref linkend="ch-options"/>). For
|
|
|
|
|
instance, the following disables tap-to-click behavior:
|
2014-08-24 18:18:18 +01:00
|
|
|
|
<programlisting>
|
2018-04-05 09:43:56 +01:00
|
|
|
|
<xref linkend="opt-services.xserver.libinput.tapping"/> = false;
|
2014-08-24 18:18:18 +01:00
|
|
|
|
</programlisting>
|
2018-05-02 00:57:09 +01:00
|
|
|
|
Note: the use of <literal>services.xserver.synaptics</literal> is deprecated
|
|
|
|
|
since NixOS 17.09.
|
|
|
|
|
</para>
|
|
|
|
|
</simplesect>
|
2018-09-02 20:45:04 +01:00
|
|
|
|
<simplesect xml:id="sec-x11-gtk-and-qt-themes">
|
2018-05-02 00:57:09 +01:00
|
|
|
|
<title>GTK/Qt themes</title>
|
|
|
|
|
<para>
|
|
|
|
|
GTK themes can be installed either to user profile or system-wide (via
|
|
|
|
|
<literal>environment.systemPackages</literal>). To make Qt 5 applications
|
|
|
|
|
look similar to GTK2 ones, you can install <literal>qt5.qtbase.gtk</literal>
|
|
|
|
|
package into your system environment. It should work for all Qt 5 library
|
|
|
|
|
versions.
|
|
|
|
|
</para>
|
|
|
|
|
</simplesect>
|
2014-08-24 18:18:18 +01:00
|
|
|
|
</chapter>
|