texlive: document LuaLaTeX font cache (#280080)

lualatex assumes a writeable font cache relative to `$HOME`, for nix this has two implications.
First, the cache might diverge from the nix store if users use LuaLaTeX.
Second, `$HOME` needs to be set to a writable path in derivations.

authored by Benedikt Tissot and committed by GitHub b28200aa aca297f0

+20
+20
doc/languages-frameworks/texlive.section.md
··· 208 208 cp test.pdf $out 209 209 '' 210 210 ``` 211 + 212 + ## LuaLaTeX font cache {#sec-language-texlive-lualatex-font-cache} 213 + 214 + The font cache for LuaLaTeX is written to `$HOME`. 215 + Therefore, it is necessary to set `$HOME` to a writable path, e.g. [before using LuaLaTeX in nix derivations](https://github.com/NixOS/nixpkgs/issues/180639): 216 + ```nix 217 + runCommandNoCC "lualatex-hello-world" { 218 + buildInputs = [ texliveFull ]; 219 + } '' 220 + mkdir $out 221 + echo '\documentclass{article} \begin{document} Hello world \end{document}' > main.tex 222 + env HOME=$(mktemp -d) lualatex -interaction=nonstopmode -output-format=pdf -output-directory=$out ./main.tex 223 + '' 224 + ``` 225 + 226 + Additionally, [the cache of a user can diverge from the nix store](https://github.com/NixOS/nixpkgs/issues/278718). 227 + To resolve font issues that might follow, the cache can be removed by the user: 228 + ```ShellSession 229 + luaotfload-tool --cache=erase --flush-lookups --force 230 + ```