Files
mt/thesis/flake.nix

70 lines
1.7 KiB
Nix
Raw Permalink Normal View History

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