config.nix/modules/misc/syncthing.nix

42 lines
812 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 = {
home.packages = with pkgs; [
localsend
];
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;
};
};
};
}