Commit 3ebb75e5c2bf

Vincent Demeester <vincent@sbr.pm>
2026-01-28 15:51:12
feat(claude): consolidate synced dirs into single claude-sync folder
Replaces separate claude-history syncthing folder with a unified claude-sync folder containing history, projects, todos, and plans. - Update globals.nix with new claude-sync folder definition - Add symlinks from ~/.config/claude/* to ~/.local/share/claude-sync/* - Enables syncing conversation history and task state across machines Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 1c7f60b
Changed files (2)
home
common
home/common/dev/ai.nix
@@ -1,9 +1,42 @@
 {
   inputs,
   pkgs,
+  config,
   ...
 }:
+let
+  claudeSyncDir = "${config.xdg.dataHome}/claude-sync";
+in
 {
+  # Ensure claude-sync directory structure exists
+  xdg.dataFile = {
+    "claude-sync/history/.keep".text = "";
+    "claude-sync/projects/.keep".text = "";
+    "claude-sync/todos/.keep".text = "";
+    "claude-sync/plans/.keep".text = "";
+  };
+
+  # Symlink claude directories to synced location
+  # force = true because claude-code may recreate these dirs during operation
+  xdg.configFile = {
+    "claude/history" = {
+      source = config.lib.file.mkOutOfStoreSymlink "${claudeSyncDir}/history";
+      force = true;
+    };
+    "claude/projects" = {
+      source = config.lib.file.mkOutOfStoreSymlink "${claudeSyncDir}/projects";
+      force = true;
+    };
+    "claude/todos" = {
+      source = config.lib.file.mkOutOfStoreSymlink "${claudeSyncDir}/todos";
+      force = true;
+    };
+    "claude/plans" = {
+      source = config.lib.file.mkOutOfStoreSymlink "${claudeSyncDir}/plans";
+      force = true;
+    };
+  };
+
   home.packages = with pkgs; [
     chmouzies-ai
     aichat
globals.nix
@@ -38,9 +38,9 @@ _: {
       id = "wpiah-ydwwx";
       path = "/home/vincent/desktop/pictures/wallpapers";
     };
-    claude-history = {
-      id = "j5zdn-6kq4t";
-      path = "/home/vincent/.claude/history";
+    claude-sync = {
+      id = "claude-sync"; # new consolidated folder
+      path = "/home/vincent/.local/share/claude-sync";
     };
   };
   net = {
@@ -182,7 +182,7 @@ _: {
           sync = { };
           screenshots = { };
           wallpapers = { };
-          claude-history = { };
+          claude-sync = { };
           # TODO: implement paused or filter theses
           # photos = {
           #   type = "receiveonly";
@@ -219,7 +219,7 @@ _: {
           sync = { };
           screenshots = { };
           wallpapers = { };
-          claude-history = { };
+          claude-sync = { };
           # photos = {
           #   type = "receiveonly";
           #   paused = true; # TODO: implement this, start as paused