From cfb6bbd7a7550aa0948d9ca74b898d388aca9dd5 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sun, 20 Oct 2024 22:06:51 +0200 Subject: [PATCH] default.nix: better source filtering --- default.nix | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/default.nix b/default.nix index d0dca1a..fa8603c 100644 --- a/default.nix +++ b/default.nix @@ -13,13 +13,20 @@ rustPlatform.buildRustPackage rec { baseName = baseNameOf (toString path); in !(lib.any (b: b) [ (!(lib.cleanSourceFilter path type)) - (baseName == "target" && type == "directory") - (baseName == "nix" && type == "directory") - (baseName == "flake.nix" && type == "regular") - (baseName == "flake.lock" && type == "regular") + (type == "directory" && lib.elem baseName [ + ".direnv" + ".git" + "target" + "result" + ]) + (type == "regular" && lib.elem baseName [ + "flake.nix" + "default.nix" + "module.nix" + ".envrc" + ]) ])) ./.; - nativeBuildInputs = [ makeWrapper ]; cargoLock = {