-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.nix
55 lines (43 loc) · 1.01 KB
/
package.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
53
54
55
{
lib,
stdenv,
typst,
font-awesome,
roboto,
source-sans-pro,
version ? "",
src ? null,
lang ? "",
}: let
l = lib.optionalString (lang != "") "_${lang}";
in
stdenv.mkDerivation {
pname = "fufexan_cv${l}";
inherit src version;
nativeBuildInputs = [typst];
configurePhase = ''
runHook preConfigure
substituteInPlace metadata.typ \
--replace 'varLanguage = ""' 'varLanguage = "${lang}"'
runHook postConfigure
'';
postConfigure = ''
mkdir src/fonts
ln -s ${font-awesome}/share/fonts/opentype/* src/fonts/
ln -s ${roboto}/share/fonts/truetype/* src/fonts/
ln -s ${source-sans-pro}/share/fonts/truetype/* src/fonts/
'';
TYPST_FONT_PATHS = "src/fonts";
buildPhase = ''
runHook preBuild
typst compile cv.typ
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out
mv *.pdf $out
mv $out/cv.pdf $out/CV${l}_MihaiFufezan.pdf
runHook postInstall
'';
}