Rust derivation needing a "missing" crate

I’m updating a derivation.nix for parinfer-rust to work with a pull request that adds emacs support.

Running cargo build with direnv works just fine, but if I try to use nix-build ., it can’t find the “emacs” crate. I’ve deduced from this that building the derivation uses some snapshot of the crates.io repository that doesn’t include this crate.

And so I found https://github.com/NixOS/nixpkgs/blob/6e4ed2ed0b116adaedeb71d3c9824e89d827dd60/pkgs/build-support/rust/crates-io.nix , which does not have the emacs package in it.

So, first, am I right so far? Is this the right direction?

If I wanted to add a package to crates-io.nix, how would I do it? It looks like it is generated, but it has manual adjustments to it, which seems bad.

But then, is there a way to convince nixpkgs to build a crate without updating this file? Either in the derivation itself or using an overlay?

OK, this is resolved. The answer was, dumbly enough, that the moduleSha256 needed to be updated and the old source was cached under the old SHA.

Good to see that problem solved! I would suggest that you mark the topic as solved using your own comment.