haskellPackages.callCabal2nixWithOptions: don't guess cabal filename

cabal only allows one cabal file per directory and cabal2nix will find
the correct file easily. Thus we don't need to know ahead of time which
cabal file to select. One downside of this is of course that we may
include unnecessary files in subdirectories, which could possibly be
fixed by enforcing depth.
This commit is contained in:
sternenseemann 2021-10-27 18:17:10 +02:00
parent a561e73b9e
commit 5d53087f9b

View file

@ -205,7 +205,7 @@ in package-set { inherit pkgs lib callPackage; } self // {
callCabal2nixWithOptions = name: src: extraCabal2nixOptions: args:
let
filter = path: type:
pkgs.lib.hasSuffix "${name}.cabal" path ||
pkgs.lib.hasSuffix ".cabal" path ||
baseNameOf path == "package.yaml";
expr = self.haskellSrc2nix {
inherit name extraCabal2nixOptions;