-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdefault.nix
52 lines (45 loc) · 1.59 KB
/
default.nix
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
48
49
50
51
52
{ nixpkgs ? <nixpkgs>
# Run "nix-build --argstr date YYYY-MM-DD" to reproduce a build:
, date ? null
}:
with import nixpkgs {};
stdenv.mkDerivation rec {
name = "anfipraesentation-${version}";
version = if (date != null)
then date
else lib.fileContents
(runCommand "anfipraesentation-date" {} "date --utc +'%F' > $out");
src = lib.cleanSource ./.;
nativeBuildInputs = [ #kpsewhich XYZ.sty
(texlive.combine {
inherit (texlive) scheme-minimal latexmk latexconfig latex latex-bin
collection-fontsrecommended fontawesome5 dejavu
etoolbox oberdiek graphics geometry hyperref url tools amsmath amscls beamer
mathtools babel babel-german hyphen-german subfig caption qrcode xkeyval
epstopdf-pkg eurosym translator;
})
];
postPatch = ''
# Set SOURCE_DATE_EPOCH to make the build reproducible:
export SOURCE_DATE_EPOCH="$(date --date=$version +'%s')"
# Override the LaTeX values for \today:
sed -i \
-e "s,\\\year=\\\year,\\\year=$(date --date=$version +'%Y')," \
-e "s,\\\month=\\\month,\\\month=$(date --date=$version +'%m')," \
-e "s,\\\day=\\\day,\\\day=$(date --date=$version +'%d')," \
presentation.tex
sed -i \
-e "s,\\\year=\\\year,\\\year=$(date --date=$version +'%Y')," \
-e "s,\\\month=\\\month,\\\month=$(date --date=$version +'%m')," \
-e "s,\\\day=\\\day,\\\day=$(date --date=$version +'%d')," \
presentation_short.tex
'';
buildPhase = ''
# Build the PDFs
make
'';
installPhase = ''
mkdir $out
cp presentation.pdf presentation_short.pdf $out/
'';
}