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 {
|
systemdTarget = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "graphical-session.target";
|
default = config.wayland.systemd.target;
|
||||||
|
defaultText = literalExpression "config.wayland.systemd.target";
|
||||||
example = "sway-session.target";
|
example = "sway-session.target";
|
||||||
description = ''
|
description = ''
|
||||||
The systemd target that will automatically start the clipman service.
|
The systemd target that will automatically start the clipman service.
|
||||||
|
@ -34,8 +35,9 @@ in {
|
||||||
systemd.user.services.clipman = {
|
systemd.user.services.clipman = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Clipboard management daemon";
|
Description = "Clipboard management daemon";
|
||||||
PartOf = [ "graphical-session.target" ];
|
PartOf = [ cfg.systemdTarget ];
|
||||||
After = [ "graphical-session.target" ];
|
After = [ cfg.systemdTarget ];
|
||||||
|
ConditionEnvironment = "WAYLAND_DISPLAY";
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
|
|
|
@ -8,6 +8,7 @@ KillMode=mixed
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
After=graphical-session.target
|
After=sway-session.target
|
||||||
|
ConditionEnvironment=WAYLAND_DISPLAY
|
||||||
Description=Clipboard management daemon
|
Description=Clipboard management daemon
|
||||||
PartOf=graphical-session.target
|
PartOf=sway-session.target
|
||||||
|
|
Loading…
Reference in a new issue