nixos/syncthing: fix folder device ID name resolution
This restores the folder (device name -> device ID) resolution the declarative folder
settings depend on, which was removed in 95e51031b4
and resulted in the following tests failing:
- syncthing-folders
- syncthing-init
As well as broke eval of the NixOS module when any folders were defined
through attribute sets and broke runtime when folders were defined
through strings.
Fixes the regression introduced in: #529449
This commit is contained in:
@@ -46,6 +46,19 @@ let
|
||||
folders = lib.pipe cfg.settings.folders [
|
||||
(lib.filterAttrs (_: folder: folder.enable))
|
||||
builtins.attrValues
|
||||
(map (
|
||||
folder:
|
||||
folder
|
||||
// {
|
||||
devices = map (
|
||||
device:
|
||||
if builtins.isString device then
|
||||
{ deviceId = cfg.settings.devices.${device}.id; }
|
||||
else
|
||||
{ deviceId = cfg.settings.devices.${device.name}.id; } // device
|
||||
) folder.devices;
|
||||
}
|
||||
))
|
||||
];
|
||||
|
||||
jq = "${pkgs.jq}/bin/jq";
|
||||
|
||||
Reference in New Issue
Block a user