wayland: create tray.target if xsession is not enabled#6332
wayland: create tray.target if xsession is not enabled#6332teto merged 1 commit intonix-community:masterfrom
Conversation
|
the target looks defined in several modules like modules/services/window-managers/wayfire.nix. / river /hyperland/sway. shouldn't the tray.target be removed from there as well ?
fine by me. We could also merge the current approach as a first step. |
f21105f to
6b4a97e
Compare
|
@teto, you're right. I've added some commits removing them to be squashed if this is to be merged. Regarding setting |
aecf6ec to
9bfea70
Compare
|
Created a |
|
Maintainer CC for xsession and wayland: |
9bfea70 to
a0f16e1
Compare
Create a internal/read-only trayTarget option for the xsession, which is also used in wayland's config, if the former is not enabled. Remove all other definitions of `systemd.user.targets.tray`, i. e, the ones from the following modules: hyprland, sway, river and wayfire.
a0f16e1 to
cb570ae
Compare
|
Just added the removal of the |
|
> + Unit = {
+ Description = "Home Manager System Tray";
+ Requires = [ "graphical-session-pre.target" ];
+ };
This is the implementation that is fine, but the option shouldn't implement a whole `Unit` unless there is a good reason to do so.
I've set it just like the implementation because, as of now, it's a
readOnly/internal option, so the user would not be allowed to change it.
Do you see a use case in which the user would have to modify
`systemd.user.target.tray`?
|
Oh ok, true, didn't realise that this was set to I can find a few cases where this would be a good idea to change it, for example I know that I would recommend at least making the actual target an option just to make sure that we can cover other use cases, but the current implementation looks fine and we can add an option later too if you want. |
I think we could create an option under the wayland module for enabling the systemd tray target, while leaving as is for the xsession one, since, on the latter, the tray target is always created. I saw that the wayland module has a # wayland module
options = {
wayland.systemd.enableTrayTarget = mkEnableOption "tray.target" // { default = true; };
};
config = mkIf config.wayland.systemd.enableTrayTarget {
systemd.user.targets.tray = config.xsession.trayTarget;
};That would allow modules, for instance, hyprland's, to not have a tray.target: # hyprland module
config = mkIf cfg.enable {
assertions = [
{
assertion = !config.wayland.systemd.enableTrayTarget;
message = ''
hyprland cannot work correctly when `wayland.systemd.enableTrayTarget` is enabled.
'';
}
];
wayland.systemd.enableTrayTarget = false;
};What do you think? |
I think the main issue is that the tray target is hardcoded to In my opinion we should:
|
|
It can be made configurable by removing the readOnly/internal attributes; however, as of now, wayland DM modules would have to access an xsession attribute to change their This goes back to what I've mention on the description of this PR:
We could either create a |
@thiagokokada, are you approving the current state of the PR or the proposed changes mentioned above? |
The current state, it doesn't make sense to approve for something that doesn't exist. I think we can merge it in the current state and change it to accommodate customization in the future. |
|
Got it. |
…#6332) Create a internal/read-only trayTarget option for the xsession, which is also used in wayland's config, if the former is not enabled. Remove all other definitions of `systemd.user.targets.tray`, i. e, the ones from the following modules: hyprland, sway, river and wayfire.
…#6332) Create a internal/read-only trayTarget option for the xsession, which is also used in wayland's config, if the former is not enabled. Remove all other definitions of `systemd.user.targets.tray`, i. e, the ones from the following modules: hyprland, sway, river and wayfire.
…#6332) Create a internal/read-only trayTarget option for the xsession, which is also used in wayland's config, if the former is not enabled. Remove all other definitions of `systemd.user.targets.tray`, i. e, the ones from the following modules: hyprland, sway, river and wayfire.
…#6332) Create a internal/read-only trayTarget option for the xsession, which is also used in wayland's config, if the former is not enabled. Remove all other definitions of `systemd.user.targets.tray`, i. e, the ones from the following modules: hyprland, sway, river and wayfire.
…#6332) Create a internal/read-only trayTarget option for the xsession, which is also used in wayland's config, if the former is not enabled. Remove all other definitions of `systemd.user.targets.tray`, i. e, the ones from the following modules: hyprland, sway, river and wayfire.
…#6332) Create a internal/read-only trayTarget option for the xsession, which is also used in wayland's config, if the former is not enabled. Remove all other definitions of `systemd.user.targets.tray`, i. e, the ones from the following modules: hyprland, sway, river and wayfire.
Create a internal/read-only trayTarget option for the xsession, which is also used in wayland's config, if the former is not enabled. Remove all other definitions of `systemd.user.targets.tray`, i. e, the ones from the following modules: hyprland, sway, river and wayfire.
as this was fixed by nix-community/home-manager#6332
Description
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:This PR addresses #6329 and
#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.targetindependently from either one ofthose modules, since virtually every graphical session that requires a
system tray would need such target.
Checklist
Change is backwards compatible. May break config of non xsession enabled
users that do not use
mkForcefor the tray target definition.Code formatted with
./format.Code tested through
nix-shell --pure tests -A run.allornix develop --ignore-environment .#allusing Flakes.Test cases updated/added. See example.
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module
Maintainer CC