2020-11-11 19:03:02 +01:00
|
|
|
{
|
|
|
|
stdenv
|
|
|
|
, fig
|
|
|
|
}:
|
2020-11-17 15:51:09 +01:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "sedReport";
|
|
|
|
src = ./report;
|
|
|
|
buildPhase = ''
|
|
|
|
grep -o '@[^ @]*@' report.tex | sed 's/@//g' | sort -u > list
|
2020-11-11 19:03:02 +01:00
|
|
|
|
2020-11-17 15:51:09 +01:00
|
|
|
echo "fig:" > fun.nix
|
|
|
|
echo "'''" >> fun.nix
|
|
|
|
sed 's:\(^.*\)$:sed -i "s;@\1@;''${\1};g" report.tex:g' list >> fun.nix
|
|
|
|
echo "'''" >> fun.nix
|
|
|
|
'';
|
|
|
|
installPhase = ''
|
|
|
|
cp fun.nix $out
|
|
|
|
'';
|
|
|
|
}
|