alexandria/2024/documents/by-course/phil-1/paper-1/package.nix

50 lines
977 B
Nix
Raw Normal View History

2024-10-19 15:13:16 -07:00
{
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