Commit c84d4dd65e76
Changed files (1)
home
common
services
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