clipman: use config.wayland.systemd.target
Also add `ConditionEnvironment`.
This commit is contained in:
parent
a6db8c8f6c
commit
656ae5aba2
2 changed files with 8 additions and 5 deletions
|
@ -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 = {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue