config.nix/modules/apps/sync/default.nix
2026-04-16 08:01:28 +02:00

73 lines
1.6 KiB
Nix

{
config,
pkgs,
inputs,
lib,
...
}:
{
options = {
apps.sync = {
kde-connect = {
enable = lib.mkEnableOption "enable kde-connect";
};
nextcloud = {
enable = lib.mkEnableOption "enable nextcloud client";
};
syncthing = {
enable = lib.mkEnableOption "enable syncthing";
devices = lib.mkOption {
default = { };
description = ''
set syncthing devices
'';
};
folders = lib.mkOption {
default = { };
description = ''
set syncthing folders
'';
};
};
};
};
config = {
environment.systemPackages =
with pkgs;
[ ]
++ (
if config.apps.sync.nextcloud.enable then
[
nextcloud-client
]
else
[ ]
);
programs = {
kdeconnect =
if config.apps.sync.kde-connect.enable then
{
enable = true;
}
else
{ };
};
services = {
syncthing =
if config.apps.sync.syncthing.enable then
{
enable = true;
guiAddress = "0.0.0.0:8384";
settings = {
devices = config.apps.sync.syncthing.devices;
folders = config.apps.sync.syncthing.folders;
};
overrideDevices = if (config.apps.sync.syncthing.devices == { }) then false else true;
overrideFolders = if (config.apps.sync.syncthing.folders == { }) then false else true;
}
else
{ };
};
};
}