clipman: use config.wayland.systemd.target

Also add `ConditionEnvironment`.
This commit is contained in:
Thiago Kenji Okada 2024-12-31 10:16:58 +00:00 committed by Robert Helgesson
parent a6db8c8f6c
commit 656ae5aba2
Failed to generate hash of commit
2 changed files with 8 additions and 5 deletions

View file

@ -11,7 +11,8 @@ in {
systemdTarget = mkOption {
type = types.str;
default = "graphical-session.target";
default = config.wayland.systemd.target;
defaultText = literalExpression "config.wayland.systemd.target";
example = "sway-session.target";
description = ''
The systemd target that will automatically start the clipman service.
@ -34,8 +35,9 @@ in {
systemd.user.services.clipman = {
Unit = {
Description = "Clipboard management daemon";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
PartOf = [ cfg.systemdTarget ];
After = [ cfg.systemdTarget ];
ConditionEnvironment = "WAYLAND_DISPLAY";
};
Service = {

View file

@ -8,6 +8,7 @@ KillMode=mixed
Restart=on-failure
[Unit]
After=graphical-session.target
After=sway-session.target
ConditionEnvironment=WAYLAND_DISPLAY
Description=Clipboard management daemon
PartOf=graphical-session.target
PartOf=sway-session.target