Choosing enabled features
The enabled features for a crate now are resolved at build time! That means you can easily override them:
-
There is a “rootFeatures” argument to the generated build file which you can override when calling it from the command line:
-
Or when importing the build file with “callPackage”:
-
Or by overriding them on the rootCrate or workspaceMembers:
Note that only dependencies for the default features are included in the build.
If you want full flexibility, you can use crate2nix generate --all-features
to
generate the most general build file. If you want to strip down the generated
build file, you may want to use crate2nix generate --no-default-features --features "feature1 feature2"
.