2023-08-24 00:19:38 +02:00
|
|
|
{ depot, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
2023-09-02 16:22:17 +02:00
|
|
|
inherit (pkgs) fontconfig texlive stdenv imagemagick runCommand qrencode;
|
2023-08-24 00:19:38 +02:00
|
|
|
|
|
|
|
tex = texlive.combine {
|
|
|
|
inherit (texlive)
|
|
|
|
babel
|
|
|
|
babel-russian
|
|
|
|
beamer
|
|
|
|
beamertheme-metropolis
|
|
|
|
etoolbox
|
|
|
|
euenc
|
|
|
|
extsizes
|
|
|
|
fontspec
|
|
|
|
listings
|
|
|
|
xetex
|
|
|
|
minted
|
|
|
|
ms
|
|
|
|
pgfopts
|
|
|
|
scheme-basic
|
|
|
|
translator;
|
|
|
|
};
|
|
|
|
|
2023-09-02 16:22:17 +02:00
|
|
|
linksQrCode = runCommand "qrcode.png" { } ''
|
|
|
|
${qrencode}/bin/qrencode -o code.png -s 8 \
|
|
|
|
--background=fafafa \
|
|
|
|
--foreground=000000 \
|
|
|
|
'https://tazj.in/blog/tvix-eval-talk-2023'
|
|
|
|
|
|
|
|
# latex has trouble with the PDF produced by qrencode
|
|
|
|
${imagemagick}/bin/convert code.png $out
|
|
|
|
'';
|
2023-08-24 00:19:38 +02:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "progmsk-tvix-eval";
|
|
|
|
src = ./.;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ tex imagemagick fontconfig ];
|
|
|
|
|
|
|
|
FONTCONFIG_FILE = pkgs.makeFontsConf {
|
|
|
|
fontDirectories = with pkgs; [ jetbrains-mono fira fira-code fira-mono ];
|
|
|
|
};
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
# LaTeX needs a cache folder in /home/ ...
|
|
|
|
mkdir home
|
|
|
|
export HOME=$PWD/home
|
|
|
|
|
2023-09-07 16:51:34 +02:00
|
|
|
cp ${depot.tvix.logo}/logo.png tvix-logo.png
|
2023-09-02 16:22:17 +02:00
|
|
|
cp ${linksQrCode} qrcode.png
|
2023-08-24 00:19:38 +02:00
|
|
|
|
|
|
|
# As usual, TeX needs to be run twice ...
|
|
|
|
${tex}/bin/xelatex presentation.tex
|
|
|
|
${tex}/bin/xelatex presentation.tex
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp presentation.pdf $out/
|
|
|
|
cp $src/presentation.pdfpc $out/
|
|
|
|
'';
|
|
|
|
}
|