nix-community / crate2nix

rebuild only changed crates in CI with crate2nix and nix
https://nix-community.github.io/crate2nix/
Apache License 2.0
352 stars 83 forks source link

Support declaring nix system dependencies in Cargo.toml #173

Open fogti opened 3 years ago

fogti commented 3 years ago

e.g. when I have a -sys crate which links against C stuff using build.rs, and could reuse already installed stuff, it would be cool if I could declare a dependency in Cargo.toml (in the package.metadata section, e.g. [package.metadata.crate2nix]), and crate2nix should then (when giving a corresponding command line flag, e.g. should be opt-in) scan the whole dependency chain and add the appropriate dependencies.

fogti commented 3 years ago

alternative: allow specifying a map from "links" defined in Cargo.toml files to nixpkgs dependencies.

danieldk commented 3 years ago

I think it is nicer to add native dependencies (at least of widely-used crates) to the default crate overrides. Then everyone benefits from them across all projects.

fogti commented 3 years ago

Ah ok.