nixos/syncthing: keep manually added dirs/devices
If folders and devices are not configured explicitly, do not wipe the changes done via the web GUI. Currently the list of devices or folders will be reset unless overrideFolders/overrideDevices is disabled.
This commit is contained in:
parent
a751bdc56b
commit
43bc09e037
1 changed files with 2 additions and 2 deletions
|
@ -55,8 +55,8 @@ let
|
|||
|
||||
# generate the new config by merging with the NixOS config options
|
||||
new_cfg=$(printf '%s\n' "$old_cfg" | ${pkgs.jq}/bin/jq -c '. * {
|
||||
"devices": (${builtins.toJSON devices}${optionalString (! cfg.overrideDevices) " + .devices"}),
|
||||
"folders": (${builtins.toJSON folders}${optionalString (! cfg.overrideFolders) " + .folders"})
|
||||
"devices": (${builtins.toJSON devices}${optionalString (cfg.devices == {} || ! cfg.overrideDevices) " + .devices"}),
|
||||
"folders": (${builtins.toJSON folders}${optionalString (cfg.folders == {} || ! cfg.overrideFolders) " + .folders"})
|
||||
} * ${builtins.toJSON cfg.extraOptions}')
|
||||
|
||||
# send the new config
|
||||
|
|
Loading…
Reference in a new issue