nixpkgs/nixos/doc/manual/configuration/x-windows.xml
aszlig 7ba9b0a41b
nixos: Fix build of manual
The build error has been introduced by 56dcc319cf.

Using a <simplesect/> within a <para/> is not allowed and subsequently
fails to validate while building the manual.

So instead, I moved the <simplesect/> further down and outside of the
<para/> to fix this.

Signed-off-by: aszlig <aszlig@nix.build>
Cc: @aaronjanse, @Lassulus, @danbst
2019-04-27 12:39:37 +02:00

160 lines
6.6 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<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">
<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:
<programlisting>
<xref linkend="opt-services.xserver.enable"/> = true;
</programlisting>
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.
<programlisting>
<xref linkend="opt-services.xserver.videoDrivers"/> = [ "r128" ];
</programlisting>
to enable X.orgs <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:
<programlisting>
<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;
<xref linkend="opt-services.xserver.desktopManager.mate.enable"/> = true;
<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;
</programlisting>
</para>
<para>
NixOSs default <emphasis>display manager</emphasis> (the program that
provides a graphical login prompt and manages the X server) is LightDM. You
can select an alternative one by picking one of the following lines:
<programlisting>
<xref linkend="opt-services.xserver.displayManager.sddm.enable"/> = true;
<xref linkend="opt-services.xserver.displayManager.slim.enable"/> = true;
</programlisting>
</para>
<para>
You can set the keyboard layout (and optionally the layout variant):
<programlisting>
<xref linkend="opt-services.xserver.layout"/> = "de";
<xref linkend="opt-services.xserver.xkbVariant"/> = "neo";
</programlisting>
</para>
<para>
The X server is started automatically at boot time. If you dont want this
to happen, you can set:
<programlisting>
<xref linkend="opt-services.xserver.autorun"/> = false;
</programlisting>
The X server can then be started manually:
<screen>
# systemctl start display-manager.service
</screen>
</para>
<para>
On 64-bit systems, if you want OpenGL for 32-bit programs such as in Wine,
you should also set the following:
<programlisting>
<xref linkend="opt-hardware.opengl.driSupport32Bit"/> = true;
</programlisting>
</para>
<simplesect xml:id="sec-x11-auto-login">
<title>Auto-login</title>
<para>
The x11 login screen can be skipped entirely, automatically logging you into
your window manager and desktop environment when you boot your computer.
</para>
<para>
This is especially helpful if you have disk encryption enabled. Since you
already have to provide a password to decrypt your disk, entering a second
password to login can be redundant.
</para>
<para>
To enable auto-login, you need to define your default window manager and
desktop environment. If you wanted no desktop environment and i3 as your your
window manager, you'd define:
<programlisting>
<xref linkend="opt-services.xserver.desktopManager.default"/> = "none";
<xref linkend="opt-services.xserver.windowManager.default"/> = "i3";
</programlisting>
And, finally, to enable auto-login for a user <literal>johndoe</literal>:
<programlisting>
<xref linkend="opt-services.xserver.displayManager.auto.enable"/> = true;
<xref linkend="opt-services.xserver.displayManager.auto.user"/> = "johndoe";
</programlisting>
</para>
</simplesect>
<simplesect xml:id="sec-x11-graphics-cards-nvidia">
<title>Proprietary NVIDIA drivers</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
its not free software. You can enable it as follows:
<programlisting>
<xref linkend="opt-services.xserver.videoDrivers"/> = [ "nvidia" ];
</programlisting>
Or if you have an older card, you may have to use one of the legacy drivers:
<programlisting>
<xref linkend="opt-services.xserver.videoDrivers"/> = [ "nvidiaLegacy390" ];
<xref linkend="opt-services.xserver.videoDrivers"/> = [ "nvidiaLegacy340" ];
<xref linkend="opt-services.xserver.videoDrivers"/> = [ "nvidiaLegacy304" ];
<xref linkend="opt-services.xserver.videoDrivers"/> = [ "nvidiaLegacy173" ];
</programlisting>
You may need to reboot after enabling this driver to prevent a clash with
other kernel modules.
</para>
</simplesect>
<simplesect xml:id="sec-x11--graphics-cards-amd">
<title>Proprietary AMD drivers</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
its not free software. You can enable it as follows:
<programlisting>
<xref linkend="opt-services.xserver.videoDrivers"/> = [ "ati_unfree" ];
</programlisting>
You will need to reboot after enabling this driver to prevent a clash with
other kernel modules.
</para>
<para>
Note: for recent AMD GPUs you most likely want to keep either the defaults
or <literal>"amdgpu"</literal> (both free).
</para>
</simplesect>
<simplesect xml:id="sec-x11-touchpads">
<title>Touchpads</title>
<para>
Support for Synaptics touchpads (found in many laptops such as the Dell
Latitude series) can be enabled as follows:
<programlisting>
<xref linkend="opt-services.xserver.libinput.enable"/> = true;
</programlisting>
The driver has many options (see <xref linkend="ch-options"/>). For
instance, the following disables tap-to-click behavior:
<programlisting>
<xref linkend="opt-services.xserver.libinput.tapping"/> = false;
</programlisting>
Note: the use of <literal>services.xserver.synaptics</literal> is deprecated
since NixOS 17.09.
</para>
</simplesect>
<simplesect xml:id="sec-x11-gtk-and-qt-themes">
<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>
</chapter>