forked from haskell/cabal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
26 lines (26 loc) · 862 Bytes
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
with (import <nixpkgs> {});
let
inherit (haskell) lib;
filterSource = drv: # only copy required source files to build directory
let
omitDirs = [ ".cabal-sandbox" ".git" "dist" ];
omitExts = [ ".o" ".hi" ];
hasExt = path: ext: stdenv.lib.hasSuffix ext path;
predicate = path: type:
if type == "directory"
then !(stdenv.lib.elem (baseNameOf path) omitDirs)
else !(stdenv.lib.any (hasExt path) omitExts);
in
lib.overrideCabal drv
(args: args // { src = builtins.filterSource predicate args.src; });
in
haskellPackages.override {
overrides = self: super: {
Cabal =
filterSource (self.callPackage ./Cabal {});
cabal-install =
filterSource (lib.dontCheck (self.callPackage ./cabal-install {}));
hackage-security =
lib.dontCheck super.hackage-security;
};
}