srid / rust-nix-template

Rust project template with Nix (Flakes) and VSCode support
https://srid.ca/rust-nix
MIT License
208 stars 21 forks source link

Make sure to mention that Cargo.lock should be regenerated after renaming the project. #7

Closed kjuulh closed 2 years ago

kjuulh commented 3 years ago

This is normal for Rust development. But it does introduce some confusion when the project only mentions changing Cargo.toml and flake.nix.

It will also give some vague error, as it will try to find the new package in the nix store. But it is obviously not there, as the project doesn't have that name in the store.

tennox commented 2 years ago

I didn't figure out how to do this without a workaround, as after changing the name the nix shell can't be opened:

++ crate2nix generate -f ./Cargo.toml -o Cargo-generated.nix -h /nix/store/mizxs1bm2jl30ylq6y2x419n1423ih4r-sonnen-scraper-crate2nix/crate-hashes.json
Error: while retrieving metadata about ./Cargo.toml: Error during execution of `cargo metadata`: error: the lock file /build/jyfdp6r1422lnbdklp6lkbz47l0cqh4k-source/Cargo.lock needs to be updated but --locked was passed to prevent this

I will submit a PR with Readme change shortly https://github.com/srid/rust-nix-template/pull/10