crane/lib/cleanCargoSource.nix
Ivan Petkov a3f0c63eed
Try to avoid IFD in vendorCargoDeps and crateNameFromCargoToml; also avoid recommending nesting cleanCargoSource and path (#641)
We don't need to nest `cleanCargoSource` and `path` just to populate a
default value for `name`. As they both ultimately delegate to
`builtins.path`, the nesting can lead to IFD in situations which are
otherwise avoidable
2024-06-10 20:53:46 -07:00

15 lines
288 B
Nix

{ filterCargoSources
, internalCrateNameForCleanSource
, lib
}:
src: lib.cleanSourceWith {
# Apply the default source cleaning from nixpkgs
src = lib.cleanSource src;
# Then add our own filter on top
filter = filterCargoSources;
name = internalCrateNameForCleanSource src;
}