diff options
author | Robin Stumm <serverkorken@gmail.com> | 2021-08-29 22:08:36 +0200 |
---|---|---|
committer | Bjørn Forsman <bjorn.forsman@gmail.com> | 2021-08-30 17:34:34 +0200 |
commit | ead3028db029d577f6dd4b2983eb093a2919a28a (patch) | |
tree | cf7d242fb5206390466af8bd534ab1f6718f4c4f /nixos/modules/services/networking/syncthing.nix | |
parent | d874a520155a73111f227744672254de0624aae5 (diff) | |
download | nixpkgs-ead3028db029d577f6dd4b2983eb093a2919a28a.tar nixpkgs-ead3028db029d577f6dd4b2983eb093a2919a28a.tar.gz nixpkgs-ead3028db029d577f6dd4b2983eb093a2919a28a.tar.bz2 nixpkgs-ead3028db029d577f6dd4b2983eb093a2919a28a.tar.lz nixpkgs-ead3028db029d577f6dd4b2983eb093a2919a28a.tar.xz nixpkgs-ead3028db029d577f6dd4b2983eb093a2919a28a.tar.zst nixpkgs-ead3028db029d577f6dd4b2983eb093a2919a28a.zip |
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.
Diffstat (limited to 'nixos/modules/services/networking/syncthing.nix')
-rw-r--r-- | nixos/modules/services/networking/syncthing.nix | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/services/networking/syncthing.nix b/nixos/modules/services/networking/syncthing.nix index d7756270149..1a1b12f979c 100644 --- a/nixos/modules/services/networking/syncthing.nix +++ b/nixos/modules/services/networking/syncthing.nix @@ -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}') |