From 76164d42395a716d4116fa43138307ac00b4b20e Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Tue, 24 Dec 2024 01:21:01 +0100 Subject: build(pkgs/back): Apply source filtering This avoids useless rebuilds, just because files like the `README.md` changed. --- pkgs/by-name/ba/back/package.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ba/back/package.nix b/pkgs/by-name/ba/back/package.nix index dbc00cb..faa0e1d 100644 --- a/pkgs/by-name/ba/back/package.nix +++ b/pkgs/by-name/ba/back/package.nix @@ -8,12 +8,21 @@ # # You should have received a copy of the License along with this program. # If not, see . -{rustPlatform}: +{ + rustPlatform, + lib, +}: rustPlatform.buildRustPackage { pname = "back"; version = "1.0.0"; - src = ./.; + src = lib.cleanSourceWith { + src = lib.cleanSource ./.; + filter = name: type: + (type == "directory") + || (builtins.elem (builtins.baseNameOf name) ["Cargo.toml" "Cargo.lock" "style.css"]) + || (lib.strings.hasSuffix ".rs" (builtins.baseNameOf name)); + }; doCheck = true; -- cgit 1.4.1