Skip to content

Commit 6b4a97e

Browse files
committed
wayland: create tray.target if xsession is not enabled
As it current stands, the tray target is only created if xsession is enabled. This causes services that depend on it to fail on wayland sessions on configurations that do not have `services.xsession.enable = true;` or the workaround as the following: ```nix {config, lib, ...}: { systemd.user.targets.tray = lib.mkIf (!config.xsession.enable) { Unit = { Description = "Home Manager System Tray"; Requires = [ "graphical-session-pre.target" ]; }; }; } ``` This PR addresses [#6329](#6329) and [#2064](#2064), albeit I do not think it is the greatest solution, since it allows the targets defined by the xsession and wayland modules to be kept out of sync. I'd recommend defining `tray.target` independently from either one of those modules, since virtually every graphical session that requires a system tray would need such target.
1 parent 9786661 commit 6b4a97e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

modules/wayland.nix

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ lib, ... }:
1+
{ config, lib, ... }:
22

33
{
44
meta.maintainers = [ lib.maintainers.thiagokokada ];
@@ -21,4 +21,13 @@
2121
};
2222
};
2323
};
24+
25+
config = lib.mkIf (!config.xsession.enable) {
26+
systemd.user.targets.tray = {
27+
Unit = {
28+
Description = "Home Manager System Tray";
29+
Requires = [ "graphical-session-pre.target" ];
30+
};
31+
};
32+
};
2433
}

0 commit comments

Comments
 (0)