From 3ca83598346bf468ff858e69dc28f30ea484be47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Madeleine=20Sydney=20=C5=9Alaga?= Date: Sat, 31 Jan 2026 16:23:04 -0700 Subject: [PATCH] feat(kdeconnect): init --- hosts/sydpc/configuration.nix | 8 ++++++-- modules/home/kdeconnect.nix | 20 ++++++++++++++++++++ modules/nixos/kdeconnect.nix | 21 +++++++++++++++++++++ users/msyds/default.nix | 1 + 4 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 modules/home/kdeconnect.nix create mode 100644 modules/nixos/kdeconnect.nix diff --git a/hosts/sydpc/configuration.nix b/hosts/sydpc/configuration.nix index 44e1551..92c1f25 100755 --- a/hosts/sydpc/configuration.nix +++ b/hosts/sydpc/configuration.nix @@ -25,14 +25,18 @@ openssh.enable = true; sydpkgs.overlay.enable = true; dank-material-shell.enable = true; + kdeconnect.enable = true; steam = { enable = true; - impermanenceUsers = ["crumb" "msyds"]; + impermanenceUsers = [ + # "crumb" + "msyds" + ]; }; users.users = [ - "crumb" + # "crumb" "msyds" ]; diff --git a/modules/home/kdeconnect.nix b/modules/home/kdeconnect.nix new file mode 100644 index 0000000..33c2ca2 --- /dev/null +++ b/modules/home/kdeconnect.nix @@ -0,0 +1,20 @@ +{ config, lib, pkgs, osConfig, ... }: + +let cfg = config.sydnix.kdeconnect; +in { + options.sydnix.kdeconnect = { + enable = lib.mkEnableOption "KDE Connect"; + }; + + config = lib.mkIf cfg.enable { + services.kdeconnect = { + enable = true; + indicator = true; + }; + + warnings = lib.optional (!osConfig.sydnix.kdeconnect.openFirewall) '' + The KDE Connect ports were not opened in the NixOS config. Make + sure someone's allowing these ports!!! + ''; + }; +} diff --git a/modules/nixos/kdeconnect.nix b/modules/nixos/kdeconnect.nix new file mode 100644 index 0000000..c400e9f --- /dev/null +++ b/modules/nixos/kdeconnect.nix @@ -0,0 +1,21 @@ +{ 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; + }); +} diff --git a/users/msyds/default.nix b/users/msyds/default.nix index f0b633c..c67b1e9 100644 --- a/users/msyds/default.nix +++ b/users/msyds/default.nix @@ -38,6 +38,7 @@ clojure.enable = true; capitaine-cursors.enable = true; terraria.enable = true; + kdeconnect.enable = true; sops = { enable = true; keyFile = "/persist/private-keys/age/crumb";