2019-06-28 16:28:37 +01:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
{
|
|
|
|
options.programs.kdeconnect = {
|
2022-08-28 20:18:44 +01:00
|
|
|
enable = mkEnableOption (lib.mdDoc ''
|
2019-06-28 16:28:37 +01:00
|
|
|
kdeconnect.
|
|
|
|
|
|
|
|
Note that it will open the TCP and UDP port from
|
|
|
|
1714 to 1764 as they are needed for it to function properly.
|
2022-08-28 20:18:44 +01:00
|
|
|
You can use the {option}`package` to use
|
|
|
|
`gnomeExtensions.gsconnect` as an alternative
|
2019-06-28 16:28:37 +01:00
|
|
|
implementation if you use Gnome.
|
2022-08-28 20:18:44 +01:00
|
|
|
'');
|
2019-06-28 16:28:37 +01:00
|
|
|
package = mkOption {
|
2022-06-06 17:22:22 +01:00
|
|
|
default = pkgs.plasma5Packages.kdeconnect-kde;
|
|
|
|
defaultText = literalExpression "pkgs.plasma5Packages.kdeconnect-kde";
|
2019-06-28 16:28:37 +01:00
|
|
|
type = types.package;
|
2021-10-03 17:06:03 +01:00
|
|
|
example = literalExpression "pkgs.gnomeExtensions.gsconnect";
|
2022-07-28 22:19:15 +01:00
|
|
|
description = lib.mdDoc ''
|
2019-06-28 16:28:37 +01:00
|
|
|
The package providing the implementation for kdeconnect.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
config =
|
|
|
|
let
|
|
|
|
cfg = config.programs.kdeconnect;
|
|
|
|
in
|
|
|
|
mkIf cfg.enable {
|
|
|
|
environment.systemPackages = [ cfg.package ];
|
|
|
|
networking.firewall = rec {
|
|
|
|
allowedTCPPortRanges = [ { from = 1714; to = 1764; } ];
|
|
|
|
allowedUDPPortRanges = allowedTCPPortRanges;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|