From 184d1b4c0f6e5e05e079a8a6cca67879a317ea2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Silva?= Date: Tue, 16 Jun 2026 11:19:02 +0100 Subject: [PATCH] nixos/uwsm: set restartIfChanged = false on session units --- nixos/modules/programs/wayland/uwsm.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/nixos/modules/programs/wayland/uwsm.nix b/nixos/modules/programs/wayland/uwsm.nix index 2ed6a643f39a..838ac2ef01de 100644 --- a/nixos/modules/programs/wayland/uwsm.nix +++ b/nixos/modules/programs/wayland/uwsm.nix @@ -37,6 +37,11 @@ let ; } ) cfg.waylandCompositors; + + sessionServices = [ + "wayland-wm@" + "wayland-session-bindpid@" + ]; in { options.programs.uwsm = { @@ -136,6 +141,17 @@ in # UWSM recommends dbus broker for better compatibility services.dbus.implementation = "broker"; + + # Restarting these kills the graphical session, same treatment as the + # display-manager modules. + systemd.user.services = lib.genAttrs sessionServices (_: { + restartIfChanged = false; + # Defining the units here generates drop-ins; without this they + # would carry the NixOS default Environment="PATH=coreutils:…", + # clobbering the PATH that uwsm imported into the user manager + # and breaking spawn actions that rely on it. + enableDefaultPath = false; + }); } (lib.mkIf (cfg.waylandCompositors != { }) {