Flake for my NixOS devices
1{...}: {
2 config,
3 lib,
4 ...
5}: {
6 options.cow.kde-connect = {
7 enable = lib.mkEnableOption "KDE connect to connect to phones";
8 dev-name = lib.mkOption {
9 type = lib.types.str;
10 description = "Name of the device in KDE connect";
11 };
12 };
13
14 config = lib.mkIf config.cow.kde-connect.enable {
15 cow.imperm.keepCache = [".config/kdeconnect"];
16 cow.firewall = let
17 r = lib.range 1714 1764;
18 in {
19 tcp = r;
20 udp = r;
21 };
22 xdg.configFile."kdeconnect/config".text = ''
23 [General]
24 name=${config.cow.kde-connect.dev-name}
25 '';
26 services.kdeconnect.enable = true;
27 systemd.user.services.kdeconnect.Service.Environment = lib.mkForce [];
28 };
29}