nixos/syncthing: fix escapes interpreted in config
Dash `echo` interprets backslash escapes. This causes two consecutive backslashes in JSON to turn into a single one before the string is passed to jq, resulting in a parsing error.
This commit is contained in:
parent
d874a52015
commit
ead3028db0
1 changed files with 1 additions and 1 deletions
|
@ -46,7 +46,7 @@ let
|
|||
old_cfg=$(curl ${cfg.guiAddress}/rest/config)
|
||||
|
||||
# generate the new config by merging with the NixOS config options
|
||||
new_cfg=$(echo "$old_cfg" | ${pkgs.jq}/bin/jq -c '. * {
|
||||
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"})
|
||||
} * ${builtins.toJSON cfg.extraOptions}')
|
||||
|
|
Loading…
Reference in a new issue