Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/kdeconnect: Added programs.kdeconnect option #63899

Merged
merged 1 commit into from Jun 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Expand Up @@ -112,6 +112,7 @@
./programs/iftop.nix
./programs/iotop.nix
./programs/java.nix
./programs/kdeconnect.nix
./programs/kbdlight.nix
./programs/less.nix
./programs/light.nix
Expand Down
35 changes: 35 additions & 0 deletions nixos/modules/programs/kdeconnect.nix
@@ -0,0 +1,35 @@
{ config, pkgs, lib, ... }:
with lib;
{
options.programs.kdeconnect = {
enable = mkEnableOption ''
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</option> to use
<code>gnomeExtensions.gsconnect</code> as an alternative
implementation if you use Gnome.
'';
package = mkOption {
default = pkgs.kdeconnect;
pasqui23 marked this conversation as resolved.
Show resolved Hide resolved
defaultText = "pkgs.kdeconnect";
type = types.package;
example = literalExample "pkgs.gnomeExtensions.gsconnect";
description = ''
doronbehar marked this conversation as resolved.
Show resolved Hide resolved
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;
};
};
}