How to build a rust package with outdated lock?

I am trying to build leftwm-theme, and I start off with a derivation like this:

 { config, pkgs, lib, rustPlatform, fetchFromGitHub, ... }:

rustPlatform.buildRustPackage rec {
  pname = "leftwm-theme";
  version = "e6907a663ec56397ccbe4f1226ac0550ec6678f0";

  src = fetchFromGitHub {
    owner = "leftwm";
    repo = pname;
    rev = version;
    sha256 = "12x6a487qzsngr99z39902v7c7f4xkwjximmn3wmzdz8bjddw2d2";
  };

  cargoSha256 = "0g6xp1dn56dfscybvrm1wmq75zi8n2lxcv81xs969a705dj5s1ml";
  meta = with lib; {
    description = "A tool to help manage themes for LeftWM";
    homepage = "https://github.com/leftwm/leftwm-theme";
    license = licenses.bsd3;
    maintainers = [];
  };
}

Then I got the following error:

Executing cargoBuildHook
++ env CC_x86_64-unknown-linux-gnu=/nix/store/74kv08wjf06ifgk4dxrnra4qhzr5s1w4-gcc-wrapper-10.3.0/bin/cc CXX_x86_64-unknown-linux-gnu=/nix/store/74kv08wjf06ifgk4dxrnra4qhzr5s1w4-gcc-wrapper-10.3.0/bin/c++ CC_x86_64-unknown-linux-gnu=/nix/store/74kv08wjf06ifgk4dxrnra4qhzr5s1w4-gcc-wrapper-10.3.0/bin/cc CXX_x86_64-unknown-linux-gnu=/nix/store/74kv08wjf06ifgk4dxrnra4qhzr5s1w4-gcc-wrapper-10.3.0/bin/c++ cargo build -j 4 --target x86_64-unknown-linux-gnu --frozen --release
error: the lock file /build/source/Cargo.lock needs to be updated but --frozen was passed to prevent this
If you want to try to generate the lock file without accessing the network, use the --offline flag.

Then I checked the doc, it mentions that I can use a patch for Cargo.lock.

As patch is a file to show the difference between the old and the updated file, I decided to folk and update the lock file in my own repo and use it to build the package for testing. However, I am still getting the exact same result. Why is that?

I’m not 100% sure, but I think the actual culprit is in Cargo.toml:

[dependencies]
clap = { git = "https://github.com/clap-rs/clap/", features=["derive"] }

I think this may cause cargo to attempt to fetch once to figure out what HEAD is, or something like that.
I would try to specify rev, tag or branch: Specifying Dependencies - The Cargo Book