about summary refs log tree commit diff
path: root/tvix/docs/default.nix
blob: 016d641df59f518f49c4e6b0b3c3a42d01013d05 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{ pkgs, lib, ... }:

let

  tl = pkgs.texlive.combine {
    inherit (pkgs.texlive) scheme-medium wrapfig ulem capt-of
      titlesec preprint enumitem paralist ctex environ svg
      beamer trimspaces zhnumber changepage framed pdfpages
      fvextra minted upquote ifplatform xstring;
  };

  csl = pkgs.fetchurl {
    name = "numeric.csl";
    url = "https://gist.githubusercontent.com/bwiernik/8c6f39cf51ceb3a03107/raw/1d75c2d62113ffbba6ed03a47ad99bde86934f2b/APA%2520Numeric";
    sha256 = "1yfhhnhbzvhrv93baz98frmgsx5y442nzhb0l956l4j35fb0cc3h";
  };

in
pkgs.stdenv.mkDerivation {
  pname = "tvix-doc";
  version = "0.1";

  outputs = [ "out" "svg" ];

  src = lib.cleanSource ./.;

  CSL = csl;

  nativeBuildInputs = [
    pkgs.pandoc
    pkgs.plantuml
    tl
  ];

  installPhase = ''
    runHook preInstall

    mkdir -p $out
    cp -v *.html $out/

    mkdir -p $svg
    cp -v *.svg $svg/

    runHook postSubmit
  '';

}