Wayland
Wayland is a modern display server protocol intended as a replacement for the legacy X11 system.
For additional details, see NixOS Manual: Chapter - Wayland.
Checking for Wayland
To check if you are using Wayland, run the following command
$ echo $XDG_SESSION_TYPE
If wayland
is returned, you are running Wayland
Setup
Two things are required for running Wayland: a compatible Display Manager, and a compatible Compositor.
Display Managers
Display Managers are responsible for handling user login.
The following Display Managers support using both X and Wayland protocols
Graphical
- gdm is the GNOME Display Manager.
- sddm is the default Display Manager for KDE. Wayland support is currently experimental.
Text-based
Compositors
For the purposes of this basic overview, a compositor can be thought of as equivalent to an X Desktop Environment.
Wayland Native
- Sway is a i3-like compositor.
- Hyprland the dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
X and Wayland support
- Mutter is the default compositor for GNOME Desktop Environment.
- KWin is the default compositor for KDE Desktop Environment.
Applications
Not all apps support running natively on Wayland. To work around this, XWayland should be enabled.
Electron and Chromium
As of NixOS 22.05 ("Quokka"), you can enable Ozone Wayland support in Chromium and Electron based applications by setting the environment variable NIXOS_OZONE_WL=1
. For example, in a configuration.nix
:
environment.sessionVariables.NIXOS_OZONE_WL = "1";
This allows these applications to run without Xwayland.