From dc906b197bc20c518e497fb040bb8240543fa634 Mon Sep 17 00:00:00 2001
From: Coutinho de Souza <dev@onemoresuza.com>
Date: Fri, 19 Apr 2024 08:30:58 -0300
Subject: [PATCH] kdeconnect: require "tray.target" for kdeconnect

Since kdeconnect-indicator is a tray application, it should require
"tray.target", as is the case for flameshot[0].

[0]: https://github.com/nix-community/home-manager/blob/b1a5b3d6a524c80c7dd20888bff227d52adf5f03/modules/services/flameshot.nix#L58
---
 modules/services/kdeconnect.nix | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/modules/services/kdeconnect.nix b/modules/services/kdeconnect.nix
index 39673131..65477be1 100644
--- a/modules/services/kdeconnect.nix
+++ b/modules/services/kdeconnect.nix
@@ -24,7 +24,6 @@ in {
         default = false;
         description = "Whether to enable kdeconnect-indicator service.";
       };
-
     };
   };
 
@@ -43,7 +42,7 @@ in {
             "Adds communication between your desktop and your smartphone";
           After = [ "graphical-session-pre.target" ];
           PartOf = [ "graphical-session.target" ];
-        };
+        } // lib.optionalAttrs cfg.indicator { Requires = [ "tray.target" ]; };
 
         Install = { WantedBy = [ "graphical-session.target" ]; };
 
@@ -82,6 +81,5 @@ in {
         };
       };
     })
-
   ];
 }