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:
parent
1b4f2a4816
commit
cb570ae910
6 changed files with 20 additions and 35 deletions
|
@ -277,12 +277,5 @@ in {
|
||||||
[ "xdg-desktop-autostart.target" ];
|
[ "xdg-desktop-autostart.target" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user.targets.tray = {
|
|
||||||
Unit = {
|
|
||||||
Description = "Home Manager System Tray";
|
|
||||||
Requires = [ "graphical-session-pre.target" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -553,13 +553,6 @@ in {
|
||||||
optional cfg.systemd.xdgAutostart "xdg-desktop-autostart.target";
|
optional cfg.systemd.xdgAutostart "xdg-desktop-autostart.target";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user.targets.tray = {
|
|
||||||
Unit = {
|
|
||||||
Description = "Home Manager System Tray";
|
|
||||||
Requires = [ "graphical-session-pre.target" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -201,12 +201,5 @@ in {
|
||||||
After = [ "graphical-session-pre.target" ];
|
After = [ "graphical-session-pre.target" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user.targets.tray = {
|
|
||||||
Unit = {
|
|
||||||
Description = "Home Manager System Tray";
|
|
||||||
Requires = [ "graphical-session-pre.target" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -189,12 +189,5 @@
|
||||||
After = [ "graphical-session-pre.target" ];
|
After = [ "graphical-session-pre.target" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user.targets.tray = {
|
|
||||||
Unit = {
|
|
||||||
Description = "Home Manager System Tray";
|
|
||||||
Requires = [ "graphical-session-pre.target" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ lib, ... }:
|
{ config, lib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
meta.maintainers = [ lib.maintainers.thiagokokada ];
|
meta.maintainers = [ lib.maintainers.thiagokokada ];
|
||||||
|
@ -21,4 +21,8 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf (!config.xsession.enable) {
|
||||||
|
systemd.user.targets.tray = config.xsession.trayTarget;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,20 @@ in {
|
||||||
xsession = {
|
xsession = {
|
||||||
enable = mkEnableOption "X Session";
|
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 {
|
scriptPath = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = ".xsession";
|
default = ".xsession";
|
||||||
|
@ -163,12 +177,7 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
tray = {
|
tray = cfg.trayTarget;
|
||||||
Unit = {
|
|
||||||
Description = "Home Manager System Tray";
|
|
||||||
Requires = [ "graphical-session-pre.target" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue