From 399a9571fd47fda4948060eb72ce3fe28a1c97eb Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Sat, 7 Feb 2026 12:47:42 -0600 Subject: [PATCH] fix: Use cleanSourceWith for better source filtering Replace sourceFilesBySuffices with cleanSourceWith to ensure vendor directory and all dependencies are properly included. This fixes the oban_met compilation error. --- nix/build.nix | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/nix/build.nix b/nix/build.nix index 9a3a5997..72212579 100644 --- a/nix/build.nix +++ b/nix/build.nix @@ -11,24 +11,30 @@ beamPackages.mixRelease { version = "0.1.0"; # Source files (filtered to exclude build artifacts) - src = lib.sourceFilesBySuffices ../. [ - ".ex" - ".exs" - ".eex" - ".heex" - ".leex" - ".erl" - ".hrl" - ".js" - ".ts" - ".css" - ".json" - ".proto" - ".md" - ".txt" - ".mib" - ".gitignore" - ]; + src = lib.cleanSourceWith { + src = ../.; + filter = + path: type: + let + baseName = baseNameOf path; + parentDir = baseNameOf (dirOf path); + in + # Exclude build artifacts and temp directories + baseName != "_build" + && baseName != "deps" + && baseName != ".elixir_ls" + && baseName != ".elixir-tools" + && baseName != "node_modules" + && baseName != "cover" + && baseName != ".git" + && baseName != ".nix-postgres" + && baseName != ".nix-redis" + && baseName != ".nix-mix" + && baseName != ".nix-hex" + && baseName != ".worktrees" + # Include vendor directory and all its contents + && (parentDir == "vendor" || baseName == "vendor" || true); + }; # Filter function to include necessary files and directories # but exclude build artifacts