From fcd3fd608449b29f1b21ed6ca27cb60290489a06 Mon Sep 17 00:00:00 2001
From: Myned <dev@bjork.tech>
Date: Wed, 26 Mar 2025 22:36:47 -0500
Subject: [PATCH] kdeconnect: move display workaround to console profile

---
 options/custom/services/kdeconnect.nix |  8 --------
 profiles/console/default.nix           | 13 +++++++++++--
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/options/custom/services/kdeconnect.nix b/options/custom/services/kdeconnect.nix
index cf2b24c..5936565 100644
--- a/options/custom/services/kdeconnect.nix
+++ b/options/custom/services/kdeconnect.nix
@@ -9,7 +9,6 @@ with lib; let
 in {
   options.custom.services.kdeconnect = {
     enable = mkOption {default = false;};
-    display = mkOption {default = null;};
     package = mkOption {default = mkForce pkgs.kdePackages.kdeconnect-kde;};
   };
 
@@ -26,13 +25,6 @@ in {
           enable = true;
           package = cfg.package;
         };
-
-        # HACK: Manually set DISPLAY variable if specified
-        systemd.user.services.kdeconnect = mkIf (!isNull cfg.display) {
-          Service = {
-            Environment = ["DISPLAY=:${toString cfg.display}"];
-          };
-        };
       }
     ];
   };
diff --git a/profiles/console/default.nix b/profiles/console/default.nix
index 89c6dd4..b87395e 100644
--- a/profiles/console/default.nix
+++ b/profiles/console/default.nix
@@ -31,8 +31,6 @@
     };
 
     services = {
-      kdeconnect.display = 0;
-
       syncthing = {
         enable = true;
         folders =
@@ -86,4 +84,15 @@
 
     decky-loader.enable = true;
   };
+
+  home-manager.sharedModules = [
+    {
+      # HACK: Manually set DISPLAY variable for use in gamemode
+      systemd.user.services.kdeconnect = {
+        Service = {
+          Environment = ["DISPLAY=:${toString config.xserver.display}"];
+        };
+      };
+    }
+  ];
 }