@@ -0,0 +1,58 @@
1+# This overlay adds hackageQuirks to provide suitable default
2+# arguments for `haskell-nix.hackage-project` and the functions
3+# that use it (like `hackage-package`)
4+#
5+self: super:
6+let
7+ inherit (self) lib;
8+
9+in { haskell-nix = super.haskell-nix // {
10+
11+ hackageQuirks = { name, version }: {
12+ # FIXME: this is required to build cabal-install 3.2 with ghc 8.6,
13+ # but also for
14+ # https://github.com/input-output-hk/haskell.nix/issues/422
15+ cabal-install = {
16+ modules = [ { reinstallableLibGhc = true; } ];
17+ };
18+
19+ hlint = {
20+ modules = [ { reinstallableLibGhc = true; } ];
21+ pkg-def-extras = [
22+ (hackage: {
23+ packages = {
24+ "alex" = (((hackage.alex)."3.2.5").revisions).default;
25+ };
26+ })
27+ ];
28+ };
29+
30+ pandoc = {
31+ # Function that returns a sha256 string by looking up the location
32+ # and tag in a nested attrset
33+ lookupSha256 = { location, tag, ... }:
34+ { "https://github.com/jgm/pandoc-citeproc"."0.17"
35+ = "0dxx8cp2xndpw3jwiawch2dkrkp15mil7pyx7dvd810pwc22pm2q"; }
36+ ."${location}"."${tag}";
37+ modules = [
38+ # Windows characters confuse cross compilation
39+ # See https://github.com/snoyberg/file-embed/pull/33
40+ (lib.optionalAttrs (version == "2.9.2.1") {
41+ packages.file-embed.src = self.fetchgit {
42+ url = "https://github.com/hamishmack/file-embed.git";
43+ rev = "12b33b8b710517308954c1facff3dc679c2dc5e3";
44+ sha256 = "0jcpja4s4cylmg9rddyakb1p1fb4l41ffwmy0njpb1dxc5z3v618";
45+ };
46+ })
47+ # Musl needs static zlib
48+ (lib.optionalAttrs self.stdenv.hostPlatform.isMusl {
49+ packages.pandoc.components.exes.pandoc.configureFlags = [
50+ "--ghc-option=-optl=-L${self.zlib.static}/lib"
51+ ];
52+ })
53+ ];
54+ };
55+
56+ }."${name}" or {};
57+
58+}; }