Is it possible to override cargoSha256 in buildRustPackage?

If you’re using .override to replace rustPlatform, you don’t need or want the final.callPackage. At best it’s going to do nothing, but if the package already was overridden to change things it’s going to lose those previous overrides. Also override gives you access to the original values, so you can customize those instead of replacing them.

final: prev:
{
  tectonic-unwrapped = prev.tectonic-unwrapped.override (old: {
    rustPlatform = old.rustPlatform // {
      buildRustPackage = args: old.rustPlatform.buildRustPackage (args // {
        # override src/cargoHash/buildFeatures here
      });
    };
  });
}
5 Likes