# TeX Live for pandoc PDF output: pandoc shells out to a LaTeX engine, so PDF # conversion needs a TeX distribution (other formats — html, docx, md — do not). # The package set is an option so a consumer can swap the scheme without editing # this module: scheme-medium covers pandoc's default LaTeX template; override # for a larger set (missing .sty files) or a smaller one. # # TeX Live's font cache and config trees default to ~/.texlive and ~/texmf # (written on the first PDF build). The TEXMF* vars route them to XDG dirs. { config, lib, pkgs, ... }: { options.local.texlive.package = lib.mkOption { type = lib.types.package; default = pkgs.texlive.withPackages (ps: [ ps.scheme-medium ]); defaultText = lib.literalExpression "pkgs.texlive.withPackages (ps: [ ps.scheme-medium ])"; description = "TeX Live package set. Override for a larger/smaller scheme."; }; config = { home.packages = [ config.local.texlive.package ]; # texmf-var is regenerable font/format cache → cacheHome; the other two hold # user config/data trees. home.sessionVariables = { TEXMFHOME = "${config.xdg.dataHome}/texmf"; TEXMFVAR = "${config.xdg.cacheHome}/texlive/texmf-var"; TEXMFCONFIG = "${config.xdg.configHome}/texlive/texmf-config"; }; }; }