Hello, I have finished up the first version of my little Nix overlay. It builds documents, and allows for you to use any package you want, not just ones in Typst Universe.
The main problem I had was using private packages was cumbersome. I came up with a way in #4040, and then just generalized it.
It’s pretty easy to use. First you must apply the overlay to your nixpkgs instance.
pkgs = import nixpkgs {
inherit system;
overlays = [ (import press) ];
}
Then you create your document’s derivation:
document = pkgs.buildTypstDocument {
src = ./;
};
If you want to add non-Universe packages, add them in the extraPackage attribute:
document = pkgs.buildTypstDocument {
src = ./.;
extraPackages = { local = [ myPackage ]; };
};
Along with other options described here.
It is definitely not done, but it is enough for me to use it usefully. Things I plan on adding:
- Adding fonts to the build environment (I have a WIP branch)
- Patching