From aa75fa1eaae8c4abd12bb33216979d0069174a29 Mon Sep 17 00:00:00 2001 From: Gabriella Gonzalez Date: Tue, 7 Nov 2023 11:23:57 -0800 Subject: [PATCH] haskell.lib.packagesFromDirectory: only `.nix` files This changes `haskell.lib.packagesFromDirectory` to ignore non-Nix files so that it doesn't attempt to run `callPackage` on, say, a `.md` file in the same directory. --- pkgs/development/haskell-modules/lib/compose.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/haskell-modules/lib/compose.nix b/pkgs/development/haskell-modules/lib/compose.nix index fa6d2a20a9a2..f3a25e293d88 100644 --- a/pkgs/development/haskell-modules/lib/compose.nix +++ b/pkgs/development/haskell-modules/lib/compose.nix @@ -407,7 +407,9 @@ rec { self: super: let - haskellPaths = builtins.attrNames (builtins.readDir directory); + haskellPaths = + lib.filter (lib.hasSuffix ".nix") + (builtins.attrNames (builtins.readDir directory)); toKeyVal = file: { name = builtins.replaceStrings [ ".nix" ] [ "" ] file;