From 51826cc3422619454e5e251b048125b217d3d663 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Tue, 7 Jun 2022 19:52:38 +0200 Subject: [PATCH] minimize treefmt rebuild --- default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/default.nix b/default.nix index db2d6d01..09895b61 100644 --- a/default.nix +++ b/default.nix @@ -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 ];