config.nix/modules/apps/sync/default.nix

60 lines
1.3 KiB
Nix

{
config,
pkgs,
inputs,
lib,
...
}:
{
options = {
apps.sync = {
kde-connect = {
enable = lib.mkEnableOption "enable kde-connect";
};
syncthing = {
enable = lib.mkEnableOption "enable syncthing";
devices = lib.mkOption {
default = { };
description = ''
set syncthing devices
'';
};
folders = lib.mkOption {
default = { };
description = ''
set syncthing folders
'';
};
};
};
};
config = {
programs = {
kdeconnect =
if config.apps.sync.kde-connect.enable then
{
enable = true;
}
else
{ };
};
services = {
syncthing =
if config.apps.sync.syncthing.enable then
{
enable = true;
tray.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
{ };
};
};
}