2023-09-12 08:44:05 -06:00
|
|
|
{ config
|
|
|
|
, lib
|
2024-03-25 07:52:07 -06:00
|
|
|
, pkgs
|
2024-02-29 08:14:45 -07:00
|
|
|
, isUnstable
|
2023-09-12 08:44:05 -06:00
|
|
|
, ...
|
|
|
|
}:
|
2024-03-15 08:03:56 -06:00
|
|
|
let
|
2024-06-26 12:27:40 -06:00
|
|
|
inherit (lib) mkIf mkEnableOption mkOption types;
|
2024-04-18 06:22:59 -06:00
|
|
|
kconnect = mkIf config.kdeConnect.enable
|
2024-04-17 20:52:06 -06:00
|
|
|
(if isUnstable then
|
|
|
|
pkgs.kdePackages.kdeconnect-kde
|
|
|
|
else
|
2024-04-18 06:22:59 -06:00
|
|
|
pkgs.plasma5Packages.kdeconnect-kde);
|
2024-03-15 08:03:56 -06:00
|
|
|
in
|
2024-04-17 20:52:06 -06:00
|
|
|
with pkgs;
|
2023-09-12 08:44:05 -06:00
|
|
|
{
|
2024-03-15 08:03:56 -06:00
|
|
|
options = {
|
|
|
|
kde = { enable = mkEnableOption "Enable KDE desktop."; };
|
|
|
|
kdeConnect = {
|
|
|
|
enable = mkEnableOption {
|
2024-07-16 11:58:39 -06:00
|
|
|
description = "Enable KDE Connect";
|
2024-03-15 08:03:56 -06:00
|
|
|
default = false;
|
|
|
|
example = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
interface = mkOption {
|
|
|
|
description = "listen interface for kde connect";
|
|
|
|
default = "tailscale0";
|
|
|
|
type = types.str;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2022-08-25 12:21:35 -06:00
|
|
|
|
2024-03-15 08:03:56 -06:00
|
|
|
config = mkIf config.kde.enable {
|
2024-06-26 12:27:40 -06:00
|
|
|
services = {
|
|
|
|
desktopManager.plasma6.enable = true;
|
|
|
|
displayManager.sddm = {
|
|
|
|
enable = true;
|
|
|
|
wayland.enable = true;
|
|
|
|
};
|
|
|
|
};
|
2022-08-25 12:21:35 -06:00
|
|
|
# Listen for KDE Connect connections on the tailnet
|
2024-03-15 08:03:56 -06:00
|
|
|
networking.firewall.interfaces = mkIf config.kdeConnect.enable {
|
|
|
|
"${config.kdeConnect.interface}" =
|
|
|
|
let
|
|
|
|
range = {
|
|
|
|
from = 1714;
|
|
|
|
to = 1764;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
allowedUDPPortRanges = [ range ];
|
|
|
|
allowedTCPPortRanges = [ range ];
|
|
|
|
};
|
2022-08-25 12:21:35 -06:00
|
|
|
};
|
2024-07-17 08:55:27 -06:00
|
|
|
environment = {
|
|
|
|
sessionVariables = {
|
|
|
|
NIXOS_OZONE_WL = 1;
|
|
|
|
};
|
2024-10-11 18:15:09 -06:00
|
|
|
systemPackages = with kdePackages; [
|
2024-07-17 08:55:27 -06:00
|
|
|
kcolorchooser
|
|
|
|
kconnect
|
2024-10-11 18:15:09 -06:00
|
|
|
kontact
|
|
|
|
korganizer
|
|
|
|
kzones
|
2024-07-17 08:55:27 -06:00
|
|
|
];
|
|
|
|
};
|
2022-08-25 12:21:35 -06:00
|
|
|
};
|
|
|
|
}
|