Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: services.kdeconnect.indicator on wayland fails over missing tray.target #6329

Open
2 tasks done
KiaraGrouwstra opened this issue Jan 17, 2025 · 4 comments
Open
2 tasks done
Assignees
Labels
bug triage Issues or feature request that have not been triaged yet

Comments

@KiaraGrouwstra
Copy link
Contributor

KiaraGrouwstra commented Jan 17, 2025

Are you following the right branch?

  • My Nixpkgs and Home Manager versions are in sync

Is there an existing issue for this?

  • I have searched the existing issues

Issue description

since #5299, I've had services.kdeconnect.indicator fail stating Unit tray.target not found.

it seems tray.target is available using xsession tho not by default on Wayland.
we may want to instead make this dependency conditional on use of xsession.

Maintainer CC

@onemoresuza

System information

- system: `"x86_64-linux"`
- host os: `Linux 6.12.2-zen1, NixOS, 24.11 (Vicuna), 24.11.20250102.c1df670`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.24.11`
- nixpkgs: `/run/current-system/nixpkgs`
@KiaraGrouwstra KiaraGrouwstra added bug triage Issues or feature request that have not been triaged yet labels Jan 17, 2025
@KiaraGrouwstra KiaraGrouwstra changed the title bug: kdeconnect service on wayland fails on missing tray.target bug: services.kdeconnect.indicator on wayland fails over missing tray.target Jan 17, 2025
@ada4a
Copy link

ada4a commented Jan 17, 2025

I think this is a duplicate of #2064?

@ada4a
Copy link

ada4a commented Jan 17, 2025

Oh, no, sorry, this is partially new after all I think. I've been having the issue described in #2064 as well, and therefore had services.kdeconnect disabled. But it turns out that I've also had services.kdeconnect.indicator enabled all this time, and now that broke with the error you described. So I think it might make sense to keep both of the issues opened.

@ada4a
Copy link

ada4a commented Jan 17, 2025

For #2064, I've also been using this workaround. So here's a version of it that's adapted to kdeconnect.indicator as well (EDIT: removed the superfluous lib.mkIf as pointed out by @onemoresuza):

systemd.user.targets.tray = {
  Unit = {
    Description = "Home Manager System Tray";
    Requires = [ "graphical-session-pre.target" ];
  };
};

@onemoresuza
Copy link
Contributor

The tray.target problem goes beyond the kdeconnect service, as it is mentioned on #2064: as it was implemented, the target is only created when services.xsession.enable = true;.

As a workaround for wayland users, @ada4a solution may be used unconditionally, i. e., without the lib.mkIf call. That would fix any other service that depends on tray.target.

onemoresuza added a commit to onemoresuza/home-manager that referenced this issue Jan 17, 2025
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 [nix-community#6329](nix-community#6329) and
[nix-community#2064](nix-community#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triage Issues or feature request that have not been triaged yet
Projects
None yet
Development

No branches or pull requests

6 participants