52 lines
1.2 KiB
Nix
52 lines
1.2 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 = lib.mkIf config.apps.sync.kde-connect.enable {
|
|
enable = true;
|
|
};
|
|
};
|
|
services = {
|
|
syncthing = lib.mkIf config.apps.sync.syncthing.enable {
|
|
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 = lib.mkIf (config.apps.sync.syncthing.devices == { }) false;
|
|
overrideFolders = lib.mkIf (config.apps.sync.syncthing.folders == { }) false;
|
|
};
|
|
};
|
|
};
|
|
}
|