Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overriding crateConfig for generated Cargo.nix #339

Open
thehabbos007 opened this issue Mar 25, 2024 · 0 comments
Open

Overriding crateConfig for generated Cargo.nix #339

thehabbos007 opened this issue Mar 25, 2024 · 0 comments

Comments

@thehabbos007
Copy link

Hey, I'm in a situation where I'd like to pass custom buildRustCrate configuration for all of my crates. I saw that there's a crateConfig option at the top level of the generated Cargo.nix, I can't seem to find any documentation for it, is it a deprecated field?

, crateConfig
? if builtins.pathExists ./crate-config.nix
then pkgs.callPackage ./crate-config.nix {}
else {}

It seems like a useful configuration option. I was thinking it could be called defaultCrateConfig and override the per-crate crateConfig here:

crateConfig =
builtins.removeAttrs crateConfig' [ "resolvedDefaultFeatures" "devDependencies" ];

With something like this:

            crateConfig = 
              lib.attrsets.recursiveUpdate 
                (builtins.removeAttrs crateConfig' [ "resolvedDefaultFeatures" "devDependencies" ]) 
                defaultCrateConfig;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant