# Is it possible to override cargoSha256 in buildRustPackage?

**URL:** https://discourse.nixos.org/t/is-it-possible-to-override-cargosha256-in-buildrustpackage/4393
**Category:** Help
**Created:** [October 16, 2019, 1:07pm UTC](https://discourse.nixos.org/t/is-it-possible-to-override-cargosha256-in-buildrustpackage/4393 "2019-10-16T13:07:34Z")
**Posts on this page:** 1
**Showing post:** 17

<div class="post-metadata">

### Author: ![waffle8946](https://discourse.nixos.org/user_avatar/discourse.nixos.org/waffle8946/32/27221_2.png) [@waffle8946](https://discourse.nixos.org/u/waffle8946)
#### Post date: [January 6, 2025, 2:22pm UTC](https://discourse.nixos.org/t/is-it-possible-to-override-cargosha256-in-buildrustpackage/4393/17 "2025-01-06T14:22:12Z")

</div>

Try this. Important part is overriding `cargoDeps`.

> [@Overriding version on Rust based package](https://discourse.nixos.org/t/overriding-version-on-rust-based-package/57445/2):
>
> (pkgs.FOO.overrideAttrs (finalAttrs: prevAttrs: { cargoHash = ""; # build and replace this src = pkgs.fetchBAR { ... }; # change fetcher version = "..."; # change this cargoDeps = pkgs.rustPlatform.fetchCargoTarball { inherit (finalAttrs) pname src version; hash = finalAttrs.cargoHash; }; } )) replace FOO, BAR, and version, cargoHash should stay empty until you build and get the hash.

---

_[View the full topic](https://discourse.nixos.org/t/is-it-possible-to-override-cargosha256-in-buildrustpackage/4393)._
