{ description = "Build LaTeX document with minted"; inputs.flake-utils.url = "github:numtide/flake-utils"; outputs = { self, nixpkgs, flake-utils, }: flake-utils.lib.eachDefaultSystem ( system: let pkgs = import nixpkgs { inherit system; }; aspellWithDicts = pkgs.aspellWithDicts (d: [ d.en ]); latex-packages = with pkgs; [ texlive.combined.scheme-full which python310Packages.pygments ]; dev-packages = with pkgs; [ texlab zathura wmctrl python312 pandoc pandoc-lua-filters ]; filtersPath = "${pkgs.pandoc-lua-filters}/share/pandoc/filters"; in { devShell = pkgs.mkShell { buildInputs = [ latex-packages dev-packages aspellWithDicts ]; }; shellHook = '' set -eu # local folder in your repo to reference in commands link_target="pandoc-filters" # refresh symlink each time you enter the shell ln -sfn ${filtersPath} "$link_target" echo "Linked $link_target -> ${filtersPath}" # (optional) write a defaults file that uses the relative symlink if [ ! -f pandoc.defaults.yaml ]; then cat > pandoc.defaults.yaml <<'YAML' from: latex to: plain wrap: none lua-filter: - pandoc-filters/latex-hyphen.lua - pandoc-filters/pandoc-quotes.lua YAML echo "Wrote pandoc.defaults.yaml" fi ''; } ); }