xin/gui/kde.nix

71 lines
1.5 KiB
Nix
Raw Normal View History

2023-09-12 08:44:05 -06:00
{ config
, lib
, pkgs
, isUnstable
2023-09-12 08:44:05 -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);
in
2024-04-17 20:52:06 -06:00
with pkgs;
2023-09-12 08:44:05 -06:00
{
options = {
kde = { enable = mkEnableOption "Enable KDE desktop."; };
kdeConnect = {
enable = mkEnableOption {
2024-07-16 11:58:39 -06:00
description = "Enable KDE Connect";
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
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
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
};
environment = {
sessionVariables = {
NIXOS_OZONE_WL = 1;
};
systemPackages = with kdePackages; [
kcolorchooser
kconnect
kontact
2024-11-18 14:58:28 -07:00
konversation
korganizer
kzones
];
};
2022-08-25 12:21:35 -06:00
};
}