Merge pull request #136090 from jakubgs/more-syncthing-options

More syncthing options
This commit is contained in:
Lassulus 2021-08-29 13:04:18 +02:00 committed by GitHub
commit 4a57860df4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,7 @@ let
devices = mapAttrsToList (name: device: {
deviceID = device.id;
inherit (device) name addresses introducer;
inherit (device) name addresses introducer autoAcceptFolders;
}) cfg.devices;
folders = mapAttrsToList ( _: folder: {
@ -149,6 +149,15 @@ in {
'';
};
autoAcceptFolders = mkOption {
type = types.bool;
default = false;
description = ''
Automatically create or share folders that this device advertises at the default path.
See <link xlink:href="https://docs.syncthing.net/users/config.html?highlight=autoaccept#config-file-format"/>.
'';
};
};
}));
};
@ -425,6 +434,15 @@ in {
defaultText = literalExample "dataDir${optionalString cond " + \"/.config/syncthing\""}";
};
extraFlags = mkOption {
type = types.listOf types.str;
default = [];
example = [ "--reset-deltas" ];
description = ''
Extra flags passed to the syncthing command in the service definition.
'';
};
openDefaultPorts = mkOption {
type = types.bool;
default = false;
@ -517,7 +535,7 @@ in {
${cfg.package}/bin/syncthing \
-no-browser \
-gui-address=${cfg.guiAddress} \
-home=${cfg.configDir}
-home=${cfg.configDir} ${escapeShellArgs cfg.extraFlags}
'';
MemoryDenyWriteExecute = true;
NoNewPrivileges = true;