diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix
index d0f94509f..5e5aeb21f 100644
--- a/modules/programs/zsh.nix
+++ b/modules/programs/zsh.nix
@@ -56,6 +56,10 @@ let
         default = if versionAtLeast stateVersion "20.03"
           then "$HOME/.zsh_history"
           else relToDotDir ".zsh_history";
+        defaultText = literalExample ''
+          "$HOME/.zsh_history" if state version ≥ 20.03,
+          "$ZDOTDIR/.zsh_history" otherwise
+        '';
         example = literalExample ''"''${config.xdg.dataHome}/zsh/zsh_history"'';
         description = "History file location";
       };