- `cargoLock` is not available in `finalAttrs`, so the headless variant will fail to evaluate with "error: attribute 'cargoLock' missing." - `buildRustPackage` lists `cargoLock` in `excludeDrvArgNames`, so `cargoLock` is stripped before `mkDerivation`: https://github.com/NixOS/nixpkgs/blob/3b32825de172d0bc85664f495edb096b10862524/pkgs/build-support/rust/build-rust-package/default.nix#L34-L37 Solution: Inherit `cargoDeps` instead, which is available through `finalAttrs`.