Using crate overrides
You can patch the individual crate derivations with crateOverrides
, for
example to add native library dependencies such as openssl!
NixOS comes with
defaultCrateOverrides
which specifies mostly some additional native buildInputs
for various popular
crates. If you are using a rust crate with native dependencies which is not yet
covered, you can add additional buildInputs
with the crateOverride
parameter
(similar to features
):
Or obviously you can use the power of nix to add a dependency conditionally:
crateOverrides
are not restricted to buildInputs however. You should also be
able to add patches and the like! (I didn’t try that, though.)
crateOverrides
are a feature of the underlying buildRustCrate
support in
NixOS
that crate2nix uses.