I think what I should have done here is that this is actually a function returning a function.
The first parameter attrs would just be the ones fillable by callPackage. And then a second parameter with the actual parameters. It is just hard to do that in backwards compatible manner...
{ nixpkgs ? {{config.nixpkgs_path | safe}}
, pkgs ? import nixpkgs { config = {}; }
, lib ? pkgs.lib
, stdenv ? pkgs.stdenv
}:
{
buildRustCrateForPkgs ? pkgs: pkgs.buildRustCrate
# This is used as the `crateOverrides` argument for `buildRustCrate`.
, defaultCrateOverrides ? pkgs.defaultCrateOverrides
# The features to enable for the root_crate or the workspace_members.
, rootFeatures ? [ "default" ]
# If true, throw errors instead of issueing deprecation warnings.
, strictDeprecation ? false
# Used for conditional compilation based on CPU feature detection.
, targetFeatures ? []
# Whether to perform release builds: longer compile times, faster binaries.
, release ? true
# Additional crate2nix configuration if it exists.
, crateConfig
? if builtins.pathExists ./crate-config.nix
then pkgs.callPackage ./crate-config.nix {}
else {}
}:
I think what I should have done here is that this is actually a function returning a function.
The first parameter attrs would just be the ones fillable by
callPackage
. And then a second parameter with the actual parameters. It is just hard to do that in backwards compatible manner..._Originally posted by @kolloch in https://github.com/kolloch/crate2nix/pull/200#discussion_r726514081_