ipetkov / crane

A Nix library for building cargo projects. Never build twice thanks to incremental artifact caching.
https://crane.dev
MIT License
969 stars 92 forks source link

crane.dev should describe how to make an existing project use crane #568

Closed lolbinarycat closed 8 months ago

lolbinarycat commented 8 months ago

as someone who has mostly avoided flakes, it was very confusing when i tried to do the quickstart and it tried to replace my existing Cargo.toml files, and also added a main.rs alongside my actual lib.rs.

ipetkov commented 8 months ago

Hi @lolbinarycat thanks for the report! The examples are pretty self-contained (as in they will have some sample cargo files) which as you mentioned, so nix flake init will end up including them as well. I've opened #569 to make the docs a bit clearer that nix flake init should be run in an empty directory (or that the flake.nix can be copied directly into an existing project)!

lolbinarycat commented 8 months ago

mostly i was very confused since nix2 commands will rarely affect the working dir besides linking result/, so it was quite unexpected.