1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2025-01-30 21:05:02 +01:00

wayland: create tray.target if xsession is not enabled

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.
This commit is contained in:
Coutinho de Souza 2025-01-17 15:35:56 -03:00
parent 1b4f2a4816
commit cb570ae910
No known key found for this signature in database
GPG key ID: 59081FCB8F9AABB5
6 changed files with 20 additions and 35 deletions

View file

@ -277,12 +277,5 @@ in {
[ "xdg-desktop-autostart.target" ];
};
};
systemd.user.targets.tray = {
Unit = {
Description = "Home Manager System Tray";
Requires = [ "graphical-session-pre.target" ];
};
};
};
}

View file

@ -553,13 +553,6 @@ in {
optional cfg.systemd.xdgAutostart "xdg-desktop-autostart.target";
};
};
systemd.user.targets.tray = {
Unit = {
Description = "Home Manager System Tray";
Requires = [ "graphical-session-pre.target" ];
};
};
}
]);
}

View file

@ -201,12 +201,5 @@ in {
After = [ "graphical-session-pre.target" ];
};
};
systemd.user.targets.tray = {
Unit = {
Description = "Home Manager System Tray";
Requires = [ "graphical-session-pre.target" ];
};
};
};
}

View file

@ -189,12 +189,5 @@
After = [ "graphical-session-pre.target" ];
};
};
systemd.user.targets.tray = {
Unit = {
Description = "Home Manager System Tray";
Requires = [ "graphical-session-pre.target" ];
};
};
};
}

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ config, lib, ... }:
{
meta.maintainers = [ lib.maintainers.thiagokokada ];
@ -21,4 +21,8 @@
};
};
};
config = lib.mkIf (!config.xsession.enable) {
systemd.user.targets.tray = config.xsession.trayTarget;
};
}

View file

@ -13,6 +13,20 @@ in {
xsession = {
enable = mkEnableOption "X Session";
trayTarget = mkOption {
readOnly = true;
internal = true;
visible = false;
description = "Common tray.target for both xsession and wayland";
type = types.attrs;
default = {
Unit = {
Description = "Home Manager System Tray";
Requires = [ "graphical-session-pre.target" ];
};
};
};
scriptPath = mkOption {
type = types.str;
default = ".xsession";
@ -163,12 +177,7 @@ in {
};
};
tray = {
Unit = {
Description = "Home Manager System Tray";
Requires = [ "graphical-session-pre.target" ];
};
};
tray = cfg.trayTarget;
};
};