crate2nix
crate2nix copied to clipboard
sqlx depends on CARGO environment variable
I'm unsure whether there's a sensible way to fix this, but sqlx macros use $CARGO to call cargo metadata.
I'm considering pulling in cargo and then overriding in an environment variable? That seems kind of ridiculous though.
I've worked around this for now with:
wag-the-pig = cargoNix.rootCrate.build.overrideAttrs (previousAttrs: {
buildPhase = ''
export CARGO=${pkgs.cargo}/bin/cargo
''
+ previousAttrs.buildPhase;
})
Maybe sqlx should accept a CARGO_METADATA environment variable, but it would need to be provided by crate2nix or buildRustCrate