Hello, I’m using Typst to write a document and I submitted patches to one of its dependencies a while ago (which got accepted) but the dependency (hayagriva) hasn’t had a release since and therefore Typst hasn’t bumped its version to include my patches. I submitted these patches back when I used Arch and now I want to use them on my NixOS machine.
I’d like to patch the Cargo.toml of typst to point at the commit hash of current HEAD of hayagriva rather than the latest release, but I’m not sure how to do that with a Nix package in a way that I can install it on my machine(s) easily.
Is there documentation somewhere for this that I’ve missed?
I’ve been trying to write an overlay for it but so far I can’t figure out a way to patch it without maintaining my own typst repository.
I wasn’t fully expecting it to work, but I tried to just substituteInPlace the hayagriva line in the Cargo.toml to see if it would lead anywhere, this failed because cargo --offline is used. Then I thought I could fetch the hayagriva source, add it to the sourcetree of typst with a patch, and sub out the hayagriva line to point at the local hayagriva revision but it turns out that hayagrivas dependencies must have changed since the last release.
error: Cannot build '/nix/store/shipydmcncnqkiv371gc4m5wsbs666i6-typst-0.14.2.drv'.
Reason: builder failed with exit code 101.
Output paths:
/nix/store/8ka24iaz3yqmns3gqbhnrx9qcih06yrk-typst-0.14.2
Last 21 log lines:
> Using versionCheckHook
> Running phase: unpackPhase
> unpacking source archive /nix/store/06hjh717cbqgkns36azna4wdd4fbf20p-source
> source root is source
> Executing cargoSetupPostUnpackHook
> Finished cargoSetupPostUnpackHook
> Running phase: patchPhase
> Executing cargoSetupPostPatchHook
> Validating consistency between /build/source/Cargo.lock and /build/typst-0.14.2-vendor/Cargo.lock
> Finished cargoSetupPostPatchHook
> Running phase: updateAutotoolsGnuConfigScriptsPhase
> Running phase: configurePhase
> Running phase: buildPhase
> Executing cargoBuildHook
> cargoBuildHook flags: -j 16 --target x86_64-unknown-linux-gnu --offline --profile release
> error: failed to select a version for the requirement `strum = "^0.26"`
> candidate versions found which didn't match: 0.27.2
> location searched: directory source `/build/typst-0.14.2-vendor` (which is replacing registry `crates-io`)
> required by package `hayagriva v0.9.1 (/build/source/crates/hayagriva)`
> perhaps a crate was updated and forgotten to be re-vendored?
> As a reminder, you're using offline mode (--offline) which can sometimes cause surprising resolution failures, if this error is too confusing you may wish to retry without `--offline`.
For full logs, run:
nix log /nix/store/shipydmcncnqkiv371gc4m5wsbs666i6-typst-0.14.2.drv