From 458f4ef48eeac51057b56f004da841f56e184349 Mon Sep 17 00:00:00 2001 From: a-kenji Date: Sun, 14 Jun 2026 21:43:10 +0200 Subject: [PATCH] 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 95e51031b49ab828a3238cf70b051ae80ec93da4 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 --- nixos/modules/services/networking/syncthing.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/nixos/modules/services/networking/syncthing.nix b/nixos/modules/services/networking/syncthing.nix index b96718675e15..0359499826f2 100644 --- a/nixos/modules/services/networking/syncthing.nix +++ b/nixos/modules/services/networking/syncthing.nix @@ -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";