tvl-depot/users/tazjin/presentations/tvix-eval-2023/default.nix
Vincent Ambo eda67bfdbe feat(tazjin/tvix-eval-2023): add link collection blog post & QR code
Makes it possible for people in the audience to get to the link
collection reasonably quickly.

Later on that post can also have the talk itself added. For now it is
unlisted.

Change-Id: If9ae1d88d3c6f22bbd70b2b3cbea0b0d42895a93
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9208
Autosubmit: tazjin <tazjin@tvl.su>
Reviewed-by: Mark Shevchenko <markshevchenko@gmail.com>
Tested-by: BuildkiteCI
2023-09-02 18:49:23 +00:00

64 lines
1.4 KiB
Nix

{ depot, pkgs, ... }:
let
inherit (pkgs) fontconfig texlive stdenv imagemagick runCommand qrencode;
tex = texlive.combine {
inherit (texlive)
babel
babel-russian
beamer
beamertheme-metropolis
etoolbox
euenc
extsizes
fontspec
listings
xetex
minted
ms
pgfopts
scheme-basic
translator;
};
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
'';
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
# webp images can't be included directly, need to convert to PNG
convert ${depot.tvix.website}/tvix-logo.webp tvix-logo.png
cp ${linksQrCode} qrcode.png
# 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/
'';
}