1 with (import <nixpkgs> {});
4 filterSource = drv: # only copy required source files to build directory
6 omitDirs = [ ".cabal-sandbox" ".git" "dist" ];
7 omitExts = [ ".o" ".hi" ];
8 hasExt = path: ext: stdenv.lib.hasSuffix ext path;
9 predicate = path: type:
10 if type == "directory"
11 then !(stdenv.lib.elem (baseNameOf path) omitDirs)
12 else !(stdenv.lib.any (hasExt path) omitExts);
15 (args: args // { src = builtins.filterSource predicate args.src; });
17 haskellPackages.override {
18 overrides = self: super: {
20 filterSource (self.callPackage ./Cabal {});
22 filterSource (lib.dontCheck (self.callPackage ./cabal-install {}));
24 lib.dontCheck super.hackage-security;