50 lines
977 B
Nix
50 lines
977 B
Nix
|
{
|
||
|
pkgs,
|
||
|
typstPackagesCache,
|
||
|
typixLib,
|
||
|
...
|
||
|
}:
|
||
|
let
|
||
|
src = typixLib.cleanTypstSource ./.;
|
||
|
commonArgs = {
|
||
|
typstSource = "main.typ";
|
||
|
|
||
|
fontPaths = [
|
||
|
# Add paths to fonts here
|
||
|
# "${pkgs.roboto}/share/fonts/truetype"
|
||
|
];
|
||
|
|
||
|
virtualPaths = [
|
||
|
# Add paths that must be locally accessible to typst here
|
||
|
# {
|
||
|
# dest = "icons";
|
||
|
# src = "${inputs.font-awesome}/svgs/regular";
|
||
|
# }
|
||
|
];
|
||
|
|
||
|
XDG_CACHE_HOME = typstPackagesCache;
|
||
|
};
|
||
|
|
||
|
# Compile a Typst project, *without* copying the result
|
||
|
# to the current directory
|
||
|
build-drv = typixLib.buildTypstProject (
|
||
|
commonArgs
|
||
|
// {
|
||
|
inherit src;
|
||
|
}
|
||
|
);
|
||
|
|
||
|
# Compile a Typst project, and then copy the result
|
||
|
# to the current directory
|
||
|
build-script = typixLib.buildTypstProjectLocal (
|
||
|
commonArgs
|
||
|
// {
|
||
|
inherit src;
|
||
|
}
|
||
|
);
|
||
|
|
||
|
# Watch a project and recompile on changes
|
||
|
watch-script = typixLib.watchTypstProject commonArgs;
|
||
|
in
|
||
|
build-drv
|