22 lines
567 B
Nix
22 lines
567 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
let cfg = config.sydnix.kdeconnect;
|
|
in {
|
|
options.sydnix.kdeconnect = {
|
|
enable = lib.mkEnableOption "KDE Connect";
|
|
openFirewall = lib.mkOption {
|
|
description = ''Open required ports for KDE Connect'';
|
|
type = lib.types.bool;
|
|
default = true;
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable
|
|
(let
|
|
port-range = lib.optional cfg.openFirewall { from = 1714; to = 1764; };
|
|
in {
|
|
networking.firewall.allowedTCPPortRanges = port-range;
|
|
networking.firewall.allowedUDPPortRanges = port-range;
|
|
});
|
|
}
|