bscpkgs/garlic/report.nix
Rodrigo Arias Mallo 81d144d716 Remove exp attrset from report
Fixes #43
2020-11-03 19:09:59 +01:00

29 lines
579 B
Nix

{
stdenv
, fig
, writeText
, busybox
, jq
, texlive
}:
let
figJSON = writeText "fig.json" (builtins.toJSON fig);
in
stdenv.mkDerivation {
name = "report";
src = ./.;
buildInputs = [ jq texlive.combined.scheme-basic ];
buildPhase = ''
ls -l
sed -i -e "s:@fig\.nbody\.test@:$(jq -r .nbody.test ${figJSON}):g" report.tex
jq . ${figJSON}
pdflatex report.tex -o report.pdf
# Run again to fix figure references
pdflatex report.tex -o report.pdf
'';
installPhase = ''
mkdir $out
cp report.* $out
'';
}