# Overriding version, can't find new cargoHash

**URL:** https://discourse.nixos.org/t/overriding-version-cant-find-new-cargohash/31502
**Category:** Help
**Created:** [August 9, 2023, 12:41pm UTC](https://discourse.nixos.org/t/overriding-version-cant-find-new-cargohash/31502 "2023-08-09T12:41:27Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![supermarin](https://discourse.nixos.org/user_avatar/discourse.nixos.org/supermarin/32/9149_2.png) [@supermarin](https://discourse.nixos.org/u/supermarin)
#### Post date: [October 19, 2023, 7:25pm UTC](https://discourse.nixos.org/t/overriding-version-cant-find-new-cargohash/31502/6 "2023-10-19T19:25:16Z")

</div>

@jacg in case you never resolved this, just remembered what it is: `overrideAttrs` works on `stdenv.mkDerivation`’s attribues, but not on `buildRustPackage`.

The key is to override `cargoDeps` instead of `cargoHash`. This answer (and the whole thread clarifies the problem).

> [@Is it possible to override cargoSha256 in buildRustPackage?](https://discourse.nixos.org/t/is-it-possible-to-override-cargosha256-in-buildrustpackage/4393/6):
>
> In case anybody tries to do this with flakes: final: prev: { mdbook-multilang = prev.mdbook.overrideAttrs (oldAttrs: rec { pname = "mdbook"; version = "pr1306"; src = prev.fetchFromGitHub { owner = "Ruin0x11"; repo = "mdBook"; rev = "9d8147c52dd9d50047ba5b29e4af99f92577806e"; sha256 = "sha256-gJnQKHssO2ChiT4d037Lncd7hiOa5uh756p8TzPzbgQ="; }; cargoDeps = oldAttrs.cargoDeps.overrideAttrs (prev.lib.const { name = "${pname}-vendor.tar.gz";…

I’m surprised that this was never tackled though.

---

_[View the full topic](https://discourse.nixos.org/t/overriding-version-cant-find-new-cargohash/31502)._
