summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--user/settings/zsh.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/user/settings/zsh.nix b/user/settings/zsh.nix
index f0030b0c..0efda5de 100644
--- a/user/settings/zsh.nix
+++ b/user/settings/zsh.nix
@@ -29,6 +29,12 @@ in
     zsh-completions
   ];
 
+  home.activation.linkOldZshHistory = config.lib.dag.entryAfter ["writeBoundary"] ''
+    if [[ ! -f ''${XDG_DATA_HOME}/zsh/history ]]; then
+      ln ${toString ./.cache/zsh/history} ''${XDG_DATA_HOME}/zsh/history
+    fi
+  '';
+
   programs.zsh = {
     enable = true;
 
@@ -41,7 +47,7 @@ in
     history = {
       expireDuplicatesFirst = true;
       extended = true;
-      path = ".cache/zsh/history";
+      path = "\${XDG_DATA_HOME#$HOME/}/zsh/history";
       save = 20000;
       size = 10000;
       share = false;