UWSM

Revision as of 04:03, 13 December 2025 by Phobos (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UWSM (Universal Wayland Session Manager), wraps standalone Wayland compositors with a set of Systemd units on the fly. This essentially binds the Wayland compositor into graphical-session-pre.target, graphical-session.target, xdg-desktop-autostart.target.

This is useful for Wayland compositors like Hyprland, Sway, Wayfire, etc. that do not start these targets and services on their own.

Additional information may be found on the UWSM Github, or the Arch Wiki page.

Installation

Options may be found under programs.uwsm in Nix options. An example using Sway with UWSM:

❄︎ /etc/nixos/configuration.nix
programs.uwsm = {
  enable = true;
  # You must configure the waylandCompositors suboptions so that UWSM knows which compositors to manage. 
  waylandCompositors = {
    sway = {
      prettyName = "Sway";
      comment = "Sway compositor managed by UWSM";
      binPath = "/run/current-system/sw/bin/sway";
    };
  };
};
Note: This by default uses dbus-broker as the dbus implementation for better compatibility. If you dislike this behavior you may set services.dbus.implementation = lib.mkForce "dbus" in your configuration.

Hyprland

Standalone Hyprland with UWSM

Hyprland has a built in option for UWSM that will automatically handle setup. Automatically starts appropriate targets such as graphical-session.target, and wayland-session@Hyprland.target. This option is recommended for if you are using Hyprland standalone, and do not need to configure alternative entries for UWSM. Usage of both options in conjunction may run into issues.

Note: Some changes may need to be made to Hyprland configs depending on your setup, see the UWSM wiki Page.
❄︎ /etc/nixos/configuration.nix
programs.hyprland = {
  enable = true;
  withUWSM = true;
};
If using the Hyprland Home Manager Module

If you use the Home Manager module, make sure to disable the systemd integration as it conflicts with UWSM.[1]

❄︎ /etc/nixos/home.nix
wayland.windowManager.hyprland.systemd.enable = false;