Help with kdeconnect

I was using the Gnome version of kdeconnect which worked fine with this home manager module:

{ config, pkgs, lib, ... }:
with lib;
{
  options.programs.kdeconnect = {
    enable = mkEnableOption (lib.mdDoc ''
      kdeconnect.
  Note that it will open the TCP and UDP port from
      1714 to 1764 as they are needed for it to function properly.
      You can use the {option}`package` to use
      `gnomeExtensions.gsconnect` as an alternative
      implementation if you use Gnome
    '');
    package = mkPackageOption pkgs [ "plasma5Packages" "kdeconnect-kde" ] {
    example = "gnomeExtensions.gsconnect";
    };

  };
}

Switching to plasma, I tried:

{ config, pkgs, lib, ... }:
with lib;
{
  options.programs.kdeconnect = {
    enable = mkEnableOption (lib.mdDoc ''
      kdeconnect.

      Note that it will open the TCP and UDP port from
      1714 to 1764 as they are needed for it to function properly.
      You can use the {option}`package` to use
      `gnomeExtensions.gsconnect` as an alternative
      implementation if you use Gnome
    '');
    package = mkPackageOption pkgs [ "plasma5Packages" "kdeconnect-kde" ] {
      example = literalExpression "pkgs.kdePackages.kdeconnect-kde";
    };
    indicator = mkOption {
        type = types.bool;
        default = true;
        description = "Whether to enable kdeconnect-indicator service.";
      };
  };
}

But I’m not getting the indicator/tray icon, and don’t see any running process.

Please help. Thanks in advance.

Edit:
changed plasma5Packages to plasma6Packages, logged out and in, still no tray indicator.

All good. Turns out I needed to reboot the system for it to take effect.

1 Like

Is there any reason why you are redefining the options? Instead of using:

{ pkgs, ... }: {
  services.kdeconnect = {
    enable = true;
    package = pkgs.kdePackages.kdeconnect-kde;
    indicator = true;
  };
}

As far as I know the indicator option is intended for non-Plasma desktops, as KDE Connect already provides a plasmoid and a tray icon.

I’m a noob to nixos and there are snippets of documentation everywhere. I found one that worked for gsconnect/gnome, which I just re-used when I switched to plasma. It does work now after a reboot, as I mentioned, but I will change to your suggestion because it is much simpler.

Thank you.

With the above I get

       error: The option `programs.kdeconnect' does not exist. Definition values:
       - In `/nix/store/zdqwimpz46kh3fq37vmagr2adqly9ypg-source/programs.nix':
           {
             enable = true;
             indicator = true;
             package = <derivation kdeconnect-kde-24.02.2>;
           }

Sorry, Home Manager uses services.kdeconnect, not programs.kdeconnect, I updated my previous reply.

Cool, that worked. Thank you.