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