1{
2 config,
3 pkgs,
4 lib,
5 ...
6}:
7{
8 options.programs.kdeconnect = {
9 enable = lib.mkEnableOption ''
10 kdeconnect.
11
12 Note that it will open the TCP and UDP port from
13 1714 to 1764 as they are needed for it to function properly.
14 You can use the {option}`package` to use
15 `gnomeExtensions.gsconnect` as an alternative
16 implementation if you use Gnome
17 '';
18 package = lib.mkPackageOption pkgs [ "kdePackages" "kdeconnect-kde" ] {
19 example = "gnomeExtensions.gsconnect";
20 };
21 };
22 config =
23 let
24 cfg = config.programs.kdeconnect;
25 in
26 lib.mkIf cfg.enable {
27 environment.systemPackages = [
28 cfg.package
29 ];
30 networking.firewall = rec {
31 allowedTCPPortRanges = [
32 {
33 from = 1714;
34 to = 1764;
35 }
36 ];
37 allowedUDPPortRanges = allowedTCPPortRanges;
38 };
39 };
40}