Commit c84d4dd65e76

Vincent Demeester <vincent@sbr.pm>
2026-06-10 14:13:21
fix(syncthing): replace hardcoded /home/vincent with homeDirectory
Syncthing folder paths in globals.nix use /home/vincent which fails on Fedora CSB where the user is vdemeest. Now dynamically replaces the path prefix with config.home.homeDirectory.
1 parent 317aa20
Changed files (1)
home
common
home/common/services/syncthing.nix
@@ -1,4 +1,5 @@
 {
+  config,
   globals,
   hostname,
   libx,
@@ -6,9 +7,14 @@
   ...
 }:
 let
-  folders =
+  homeDir = config.home.homeDirectory;
+  # Replace hardcoded /home/vincent with actual home directory
+  fixPath = path: builtins.replaceStrings [ "/home/vincent" ] [ homeDir ] path;
+  rawFolders =
     libx.generateSyncthingFolders hostname globals.machines."${hostname}" globals.machines
       globals.syncthingFolders;
+  # Re-key folders with fixed paths (the attr name IS the path in syncthing config)
+  folders = lib.mapAttrs' (path: folder: lib.nameValuePair (fixPath path) folder) rawFolders;
   folderNames = lib.mapAttrsToList (id: folder: folder.label or id) folders;
   folderList = lib.concatStringsSep ", " folderNames;
 in