minimize treefmt rebuild

This commit is contained in:
zimbatm 2022-06-07 19:52:38 +02:00
parent ac9fbe6bf9
commit 51826cc342
No known key found for this signature in database
GPG Key ID: 71BAF6D40C1D63D7

View File

@ -15,7 +15,15 @@ let
treefmt = rustPackages.rustPlatform.buildRustPackage {
inherit (cargoToml.package) name version;
src = nixpkgs.lib.cleanSource ./.;
src = builtins.path {
path = ./.;
filter = name: type:
name == toString ./Cargo.toml
|| name == toString ./Cargo.lock
|| lib.hasPrefix (toString ./src) name
|| lib.hasPrefix (toString ./benches) name
;
};
buildInputs = with nixpkgs; lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security libiconv ];