diff --git a/options/custom/services/default.nix b/options/custom/services/default.nix index dc29e54..390e599 100644 --- a/options/custom/services/default.nix +++ b/options/custom/services/default.nix @@ -17,7 +17,7 @@ with lib; { dbus.enable = true; flatpak.enable = true; fwupd.enable = true; - #// kdeconnect.enable = true; + kdeconnect.enable = true; libinput.enable = true; logind.enable = true; openrazer.enable = true; diff --git a/options/custom/services/kdeconnect.nix b/options/custom/services/kdeconnect.nix index d1cf951..cf2b24c 100644 --- a/options/custom/services/kdeconnect.nix +++ b/options/custom/services/kdeconnect.nix @@ -1,15 +1,39 @@ { config, lib, + pkgs, ... }: with lib; let cfg = config.custom.services.kdeconnect; in { - options.custom.services.kdeconnect.enable = mkOption {default = false;}; + options.custom.services.kdeconnect = { + enable = mkOption {default = false;}; + display = mkOption {default = null;}; + package = mkOption {default = mkForce pkgs.kdePackages.kdeconnect-kde;}; + }; - config.home-manager.users.${config.custom.username} = mkIf cfg.enable { + config = mkIf cfg.enable { # https://github.com/KDE/kdeconnect-kde - services.kdeconnect.enable = true; + programs.kdeconnect = { + enable = true; + package = cfg.package; + }; + + home-manager.sharedModules = [ + { + services.kdeconnect = { + 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}"]; + }; + }; + } + ]; }; }