diff --git a/compiler/options.nim b/compiler/options.nim index ef2b6023a6..537a550f8c 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -482,7 +482,7 @@ include packagehandling proc getOsCacheDir(): string = when defined(posix): - result = string getEnv("XDG_CACHE_HOME", getHomeDir() / ".cache") + result = getEnv("XDG_CACHE_HOME", getHomeDir() / ".cache") / "nim" else: result = getHomeDir() / genSubDir diff --git a/doc/nimc.rst b/doc/nimc.rst index fca5b273cf..a33be39e6d 100644 --- a/doc/nimc.rst +++ b/doc/nimc.rst @@ -159,7 +159,7 @@ Generated C code directory The generated files that Nim produces all go into a subdirectory called ``nimcache``. Its full path is -- ``$XDG_CACHE_HOME/$projectname(_r|_d)`` or ``~/.cache/$projectname(_r|_d)`` +- ``$XDG_CACHE_HOME/nim/$projectname(_r|_d)`` or ``~/.cache/nim/$projectname(_r|_d)`` on Posix - ``$HOME/nimcache/$projectname(_r|_d)`` on Windows.