syncthing: Enable if needed
This commit is contained in:
parent
91e71bec07
commit
81b1307609
|
@ -22,10 +22,13 @@ let
|
|||
|
||||
folderShouldSyncWith = folder: device: (lib.hasAttrByPath [ folder.name ] device.folders) && device.folders.${folder.name}.syncthing.enable;
|
||||
folderDeviceEntry = folder: device: { deviceID = device.syncthing.id; };
|
||||
|
||||
enable = (builtins.length syncedFolders) > 0;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg.enable {
|
||||
config = {
|
||||
services.${service} = {
|
||||
inherit enable;
|
||||
openDefaultPorts = true;
|
||||
configDir = "/var/lib/${service}";
|
||||
databaseDir = "/var/cache/${service}";
|
||||
|
|
Loading…
Reference in a new issue