tvl-depot/users/flokli/presentations/2023-09-13-asg-tvix-store/default.nix
Florian Klink 0bc686448c feat(users/flokli/slides/2023-asg): add pdf
Change-Id: I85b1f2a9bb99df01546f3d0d3f60d9953f1d8d61
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12684
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
2024-10-26 10:13:46 +00:00

36 lines
1 KiB
Nix

{ depot, pkgs, ... }:
let
inherit (pkgs)
fontconfig qrencode runCommand stdenv;
mkQr = url: runCommand "qrcode.png" { } ''
${qrencode}/bin/qrencode -o $out -t SVG -s 5 \
--background=fafafa \
--foreground=000000 \
${url}
'';
in
stdenv.mkDerivation {
name = "2023-asg-tvix-store";
src = ./.;
FONTCONFIG_FILE = pkgs.makeFontsConf {
fontDirectories = with pkgs; [ jetbrains-mono fira fira-code fira-mono lato ];
};
nativeBuildInputs = [ pkgs.reveal-md pkgs.graphviz ];
buildPhase = ''
cp ${depot.tvix.logo}/logo.png tvix-logo.png
cp ${mkQr "https://flokli.de"} qrcode-flokli.svg
cp ${mkQr "https://tvix.dev"} qrcode-tvix.svg
mkdir -p $out
cp tvix-store-graph-blob-directory.svg $out/
reveal-md --static $out presentation.md
CHROME_CONFIG_HOME=/build/.config reveal-md presentation.md --print $out/slides.pdf --puppeteer-chromium-executable="${pkgs.chromium}/bin/chromium"
# Above command doesn't fail on error, ensure file has been created
[[ -f "$out/slides.pdf" ]] || exit 1
'';
}