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.
This commit is contained in:
Gabriella Gonzalez 2023-11-07 11:23:57 -08:00
parent 5cd7971391
commit aa75fa1eaa

View File

@ -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;