From b1bb534c17f84915c80ed2ae603680875ce1256c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C2=B2?= <1407797+josqu4red@users.noreply.github.com> Date: Sun, 30 Nov 2025 14:35:54 +0100 Subject: [PATCH] xsession: only require xdg autostart target if explicitely enabled (#8237) This is a fix for PR #7108 that forcibly enables xdg-desktop-autostart units, whether or not `config.xdg.autostart` is enabled. Partially fixes #7708, there is still a risk for conflict if `xdg.autostart` and `services.picom` are enabled. --- modules/xsession.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/xsession.nix b/modules/xsession.nix index c980a00f3..81ecd254d 100644 --- a/modules/xsession.nix +++ b/modules/xsession.nix @@ -188,10 +188,13 @@ in hm-graphical-session = { Unit = { Description = "Home Manager X session"; - Requires = [ - "graphical-session-pre.target" - "xdg-desktop-autostart.target" - ]; + Requires = + let + requires = lib.optional (config.xdg.autostart.enable) "xdg-desktop-autostart.target" ++ [ + "graphical-session-pre.target" + ]; + in + requires; BindsTo = [ "graphical-session.target" "tray.target"