diff options
author | Andrew Barchuk <andrew@raindev.io> | 2022-10-29 14:22:45 +0200 |
---|---|---|
committer | Andrew Barchuk <andrew@raindev.io> | 2022-10-30 00:22:00 +0200 |
commit | 43bc09e03794f3aa4585a1a39925dca5e90a2c14 (patch) | |
tree | 1ed5a6af96515b1d5cb6038818c453d275a0cec9 /nixos/modules/services/networking/syncthing.nix | |
parent | a751bdc56b9741f4fb5e43c7dbb0a28e1e7ebf7c (diff) | |
download | nixpkgs-43bc09e03794f3aa4585a1a39925dca5e90a2c14.tar nixpkgs-43bc09e03794f3aa4585a1a39925dca5e90a2c14.tar.gz nixpkgs-43bc09e03794f3aa4585a1a39925dca5e90a2c14.tar.bz2 nixpkgs-43bc09e03794f3aa4585a1a39925dca5e90a2c14.tar.lz nixpkgs-43bc09e03794f3aa4585a1a39925dca5e90a2c14.tar.xz nixpkgs-43bc09e03794f3aa4585a1a39925dca5e90a2c14.tar.zst nixpkgs-43bc09e03794f3aa4585a1a39925dca5e90a2c14.zip |
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.
Diffstat (limited to 'nixos/modules/services/networking/syncthing.nix')
-rw-r--r-- | nixos/modules/services/networking/syncthing.nix | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/services/networking/syncthing.nix b/nixos/modules/services/networking/syncthing.nix index 0876007a6e7..ea87e5695f8 100644 --- a/nixos/modules/services/networking/syncthing.nix +++ b/nixos/modules/services/networking/syncthing.nix @@ -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 |