2025-02-21 10:26:36 +01:00
|
|
|
{
|
|
|
|
|
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; };
|
|
|
|
|
|
2025-10-11 18:09:18 +02:00
|
|
|
aspellWithDicts = pkgs.aspellWithDicts (d: [ d.en ]);
|
|
|
|
|
|
2025-02-21 10:26:36 +01:00
|
|
|
latex-packages = with pkgs; [
|
|
|
|
|
texlive.combined.scheme-full
|
|
|
|
|
which
|
2025-07-01 14:46:26 +02:00
|
|
|
python310Packages.pygments
|
2025-02-21 10:26:36 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
dev-packages = with pkgs; [
|
|
|
|
|
texlab
|
|
|
|
|
zathura
|
|
|
|
|
wmctrl
|
2025-08-13 14:14:54 +02:00
|
|
|
python312
|
2025-10-18 12:19:26 +02:00
|
|
|
pandoc
|
|
|
|
|
pandoc-lua-filters
|
2025-02-21 10:26:36 +01:00
|
|
|
];
|
2025-10-18 12:19:26 +02:00
|
|
|
filtersPath = "${pkgs.pandoc-lua-filters}/share/pandoc/filters";
|
2025-02-21 10:26:36 +01:00
|
|
|
in
|
|
|
|
|
{
|
|
|
|
|
devShell = pkgs.mkShell {
|
|
|
|
|
buildInputs = [
|
|
|
|
|
latex-packages
|
|
|
|
|
dev-packages
|
2025-10-11 18:09:18 +02:00
|
|
|
aspellWithDicts
|
2025-02-21 10:26:36 +01:00
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
|
2025-10-18 12:19:26 +02:00
|
|
|
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
|
|
|
|
|
'';
|
|
|
|
|
|
2025-02-21 10:26:36 +01:00
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|