Skip to content

Commit ee72377

Browse files
committed
chore: simplify Nix file, remove custom typst-wrapper
1 parent 7276777 commit ee72377

File tree

1 file changed

+12
-26
lines changed

1 file changed

+12
-26
lines changed

flake.nix

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -45,42 +45,26 @@
4545
];
4646
};
4747

48-
typst-wrapper-factory =
49-
typstDrv: typst-packages: typstFontPaths:
50-
pkgs.writeShellApplication {
51-
name = "typst-wrapper";
52-
53-
runtimeInputs = [
54-
typstDrv
55-
typst-packages
56-
];
57-
58-
text = ''
59-
TYPST_FONT_PATHS=${typstFontPaths} TYPST_PACKAGE_PATH=${typst-packages} ${lib.getExe typstDrv} "$@"
60-
'';
61-
};
62-
63-
typst-wrapper = typst-wrapper-factory typst config.packages.typst-packages fontsConf;
64-
6548
mkBuildDocumentDrv =
6649
documentName:
6750
pkgs.stdenvNoCC.mkDerivation {
6851
name = "build-" + documentName;
6952

7053
src = pkgs.lib.cleanSource ./.;
7154

72-
buildInputs = [ typst-wrapper ];
55+
buildInputs = [ typst ];
7356

7457
buildPhase = ''
7558
runHook preBuild
76-
77-
${lib.getExe typst-wrapper} \
59+
${lib.getExe typst} \
7860
compile \
7961
--root ./. \
8062
--input rev="${inputs.self.rev or ""}" \
8163
--input shortRev="${inputs.self.shortRev or ""}" \
8264
--input builddate="$(date -u -d @${toString (inputs.self.lastModified or "")})" \
65+
--package-path ${inputs.typst-packages}/packages \
8366
--font-path ${fontsConf} \
67+
--ignore-system-fonts \
8468
./src/${documentName}/main.typ \
8569
${documentName}.pdf
8670
@@ -101,16 +85,18 @@
10185
pkgs.writeShellApplication {
10286
name = "build-${documentName}";
10387

104-
runtimeInputs = [ typst-wrapper ];
88+
runtimeInputs = [ typst ];
10589

10690
text = ''
107-
${lib.getExe typst-wrapper} \
91+
${lib.getExe typst} \
10892
compile \
10993
--root ./. \
11094
--input rev="${inputs.self.rev or ""}" \
11195
--input shortRev="${inputs.self.shortRev or ""}" \
11296
--input builddate="$(date -u -d @${toString (inputs.self.lastModified or "")})" \
97+
--package-path ${inputs.typst-packages}/packages \
11398
--font-path ${fontsConf} \
99+
--ignore-system-fonts \
114100
./src/${documentName}/main.typ \
115101
${documentName}.pdf
116102
'';
@@ -121,16 +107,18 @@
121107
pkgs.writeShellApplication {
122108
name = "watch-${documentName}";
123109

124-
runtimeInputs = [ typst-wrapper ];
110+
runtimeInputs = [ typst ];
125111

126112
text = ''
127-
${lib.getExe typst-wrapper} \
113+
${lib.getExe typst} \
128114
watch \
129115
--root ./. \
130116
--input rev="${inputs.self.rev or ""}" \
131117
--input shortRev="${inputs.self.shortRev or ""}" \
132118
--input builddate="$(date -u -d @${toString (inputs.self.lastModified or "")})" \
119+
--package-path ${inputs.typst-packages}/packages \
133120
--font-path ${fontsConf} \
121+
--ignore-system-fonts \
134122
./src/${documentName}/main.typ \
135123
${documentName}.pdf
136124
'';
@@ -160,7 +148,6 @@
160148
devShells.default = pkgs.mkShellNoCC {
161149
packages = (lib.attrValues scriptDrvs) ++ [
162150
typst
163-
typst-wrapper
164151
pkgs.gnuplot
165152
config.packages.weasel
166153
config.packages.passive
@@ -170,7 +157,6 @@
170157
shellHook = ''
171158
echo "Typst version: ${typst.version}"
172159
echo "Typst bin: ${lib.getExe typst}"
173-
echo "Typst wrapper bin: ${lib.getExe typst-wrapper}"
174160
echo "Typst packages directory: ${config.packages.typst-packages}"
175161
echo "Typst fonts directory: ${fontsConf}"
176162
'';

0 commit comments

Comments
 (0)