gui/kde: add a kdeConnect option and enable it in europa

This commit is contained in:
Aaron Bieber 2024-03-15 08:03:56 -06:00
parent 9e80fa6917
commit 12de1420cb
No known key found for this signature in database
2 changed files with 41 additions and 11 deletions

View File

@ -3,12 +3,30 @@
, isUnstable , isUnstable
, ... , ...
}: }:
let
inherit (lib) mkIf mkEnableOption mkMerge mkOption types;
in
{ {
options = { kde = { enable = lib.mkEnableOption "Enable KDE desktop."; }; }; options = {
kde = { enable = mkEnableOption "Enable KDE desktop."; };
kdeConnect = {
enable = mkEnableOption {
description = "Enable PipeWire";
default = false;
example = true;
};
config = lib.mkIf config.kde.enable { interface = mkOption {
description = "listen interface for kde connect";
default = "tailscale0";
type = types.str;
};
};
};
config = mkIf config.kde.enable {
services.xserver = services.xserver =
lib.mkMerge [ mkMerge [
(if isUnstable then { (if isUnstable then {
desktopManager.plasma6.enable = true; desktopManager.plasma6.enable = true;
displayManager.sddm.wayland.enable = true; displayManager.sddm.wayland.enable = true;
@ -22,13 +40,19 @@
]; ];
# Listen for KDE Connect connections on the tailnet # Listen for KDE Connect connections on the tailnet
networking.firewall.interfaces = { networking.firewall.interfaces = mkIf config.kdeConnect.enable {
"tailscale0" = { "${config.kdeConnect.interface}" =
allowedTCPPorts = lib.range 1714 1764; let
allowedUDPPorts = lib.range 1714 1764; range = {
}; from = 1714;
to = 1764;
};
in
{
allowedUDPPortRanges = [ range ];
allowedTCPPortRanges = [ range ];
};
}; };
programs.kdeconnect.enable = config.kdeConnect.enable;
programs.kdeconnect.enable = true;
}; };
} }

View File

@ -137,6 +137,7 @@ in
}; };
kde.enable = lib.mkDefault true; kde.enable = lib.mkDefault true;
kdeConnect.enable = true;
virtualisation.libvirtd.enable = lib.mkDefault true; virtualisation.libvirtd.enable = lib.mkDefault true;
@ -152,7 +153,12 @@ in
firewall = { firewall = {
enable = true; enable = true;
allowedTCPPorts = [ 22 ]; allowedTCPPorts = [ 22 ];
interfaces = { "tailscale0" = { allowedTCPPorts = [ 8384 ]; }; }; interfaces = {
"tailscale0" =
{
allowedTCPPorts = [ 8384 ];
};
};
}; };
}; };