39 lines
756 B
Nix
39 lines
756 B
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
|
|
{
|
|
options = {
|
|
syncthing.devices = lib.mkOption {
|
|
default = { };
|
|
description = ''
|
|
set syncthing devices
|
|
'';
|
|
};
|
|
syncthing.folders = lib.mkOption {
|
|
default = { };
|
|
description = ''
|
|
set syncthing folders
|
|
'';
|
|
};
|
|
};
|
|
|
|
config = {
|
|
services = {
|
|
syncthing = {
|
|
enable = true;
|
|
tray.enable = true;
|
|
guiAddress = "0.0.0.0:8384";
|
|
settings = {
|
|
devices = config.syncthing.devices;
|
|
folders = config.syncthing.folders;
|
|
};
|
|
overrideDevices = lib.mkIf (config.syncthing.devices == { }) false;
|
|
overrideFolders = lib.mkIf (config.syncthing.folders == { }) false;
|
|
};
|
|
};
|
|
};
|
|
}
|