diff --git a/flake-module.nix b/flake-module.nix index a23f9b7a..ab7e59e0 100644 --- a/flake-module.nix +++ b/flake-module.nix @@ -169,9 +169,18 @@ in localPackagesOverlay = self: _: let fromSdist = self.buildFromCabalSdist or (builtins.trace "Your version of Nixpkgs does not support hs.buildFromCabalSdist yet." (pkg: pkg)); + filterSrc = name: src: lib.cleanSourceWith { inherit src name; filter = path: type: true; }; in lib.mapAttrs - (name: value: fromSdist (self.callCabal2nix name value.root { })) + (name: value: + let + # callCabal2nix does not need a filtered source. It will + # only pick out the cabal and/or hpack file. + pkgProto = self.callCabal2nix name value.root { }; + pkgFiltered = pkgs.haskell.lib.overrideSrc pkgProto { + src = filterSrc name value.root; + }; + in fromSdist pkgFiltered) cfg.packages; finalOverlay = pkgs.lib.composeManyExtensions