about summary refs log tree commit diff
path: root/users/tazjin/presentations/tvix-eval-2023/default.nix
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2023-08-23T22·19+0300
committerclbot <clbot@tvl.fyi>2023-09-01T13·50+0000
commiteb0b33db729962a612000e97df7fc820bcc2973e (patch)
tree70a7e544358ce40f70ede61e34c25257a2b7463e /users/tazjin/presentations/tvix-eval-2023/default.nix
parent88c3e2b4a0cf5ca8ca76ba828eecfc16e22267de (diff)
feat(tazjin/presentations): bootstrap tvix-eval-2023 presentation r/6540
I spent way too much time fighting LaTeX to do roughly what I want
here again, but all the alternatives are even worse.

Change-Id: Ibe12a4ce175ceb73e9d6e276613dcd4827dd76c4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9150
Autosubmit: tazjin <tazjin@tvl.su>
Reviewed-by: Mark Shevchenko <markshevchenko@gmail.com>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/tazjin/presentations/tvix-eval-2023/default.nix')
-rw-r--r--users/tazjin/presentations/tvix-eval-2023/default.nix54
1 files changed, 54 insertions, 0 deletions
diff --git a/users/tazjin/presentations/tvix-eval-2023/default.nix b/users/tazjin/presentations/tvix-eval-2023/default.nix
new file mode 100644
index 000000000000..6b3076895097
--- /dev/null
+++ b/users/tazjin/presentations/tvix-eval-2023/default.nix
@@ -0,0 +1,54 @@
+{ depot, pkgs, ... }:
+
+let
+  inherit (pkgs) fontconfig texlive stdenv imagemagick;
+
+  tex = texlive.combine {
+    inherit (texlive)
+      babel
+      babel-russian
+      beamer
+      beamertheme-metropolis
+      etoolbox
+      euenc
+      extsizes
+      fontspec
+      listings
+      xetex
+      minted
+      ms
+      pgfopts
+      scheme-basic
+      translator;
+  };
+
+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
+
+    # 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/
+  '';
+}