Overriding version on Rust based package

(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.

1 Like