Guest User

default.nix

a guest
May 11th, 2019
167
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. { rpRef ? "f3ff81d519b226752c83eefd4df6718539c3efdc", rpSha ? "1ijxfwl36b9b2j4p9j3bv8vf7qfi570m1c5fjyvyac0gy0vi5g8j", system ? builtins.currentSystem }:
  2.  
  3. let rp = builtins.fetchTarball {
  4. url = "https://github.com/reflex-frp/reflex-platform/archive/${rpRef}.tar.gz";
  5. sha256 = rpSha;
  6. };
  7. overlay = self: super: {
  8. z3 = super.z3.overrideAttrs (drv: {
  9. src = self.fetchFromGitHub {
  10. owner = "Z3Prover";
  11. repo = "z3";
  12. rev = "727929c9af003d71eab1f0d90cc8e01761943491";
  13. sha256 = "02p8rhflimc852ysgf7nmaypz6ga3w4iss3z8d3qrby5a2d464p9";
  14. };
  15. });
  16. };
  17.  
  18. in
  19. (import rp { inherit system; nixpkgsOverlays = [ overlay ]; }).project ({ pkgs, ... }:
  20. let gitignore = pkgs.callPackage (pkgs.fetchFromGitHub {
  21. owner = "siers";
  22. repo = "nix-gitignore";
  23. rev = "4f2d85f2f1aa4c6bff2d9fcfd3caad443f35476e";
  24. sha256 = "1vzfi3i3fpl8wqs1yq95jzdi6cpaby80n8xwnwa8h2jvcw3j7kdz";
  25. }) {};
  26. in
  27. {
  28. name = "pact";
  29. overrides = self: super: with pkgs.haskell.lib;
  30. let guardGhcjs = p: if self.ghc.isGhcjs or false then null else p;
  31. whenGhcjs = f: p: if self.ghc.isGhcjs or false then (f p) else p;
  32. in {
  33. pact = doCoverage (addBuildDepend super.pact pkgs.z3);
  34. haskeline = guardGhcjs super.haskeline;
  35.  
  36. # tests for extra were failing due to an import clash (`isWindows`)
  37. extra = dontCheck super.extra;
  38. # tests try to use ghc-pkg and cabal (https://github.com/sol/doctest/issues/213)
  39. doctest = guardGhcjs (dontCheck (self.callHackage "doctest" "0.16.0" {}));
  40. # these want to use doctest, which doesn't work on ghcjs
  41. bytes = dontCheck super.bytes;
  42. intervals = dontCheck super.intervals;
  43. bound = dontCheck super.bound;
  44. trifecta = dontCheck super.trifecta;
  45. lens-aeson = dontCheck super.lens-aeson;
  46. # test suite for this is failing on ghcjs:
  47. hw-hspec-hedgehog = dontCheck super.hw-hspec-hedgehog;
  48.  
  49. bsb-http-chunked = whenGhcjs dontCheck super.bsb-http-chunked;
  50. Glob = whenGhcjs dontCheck super.Glob;
  51. http2 = whenGhcjs dontCheck super.http2;
  52. http-date = whenGhcjs dontCheck super.http-date;
  53. http-media = whenGhcjs dontCheck super.http-media;
  54. iproute = whenGhcjs dontCheck super.iproute;
  55. markdown-unlit = whenGhcjs dontCheck super.markdown-unlit;
  56. mockery = whenGhcjs dontCheck super.mockery;
  57. silently = whenGhcjs dontCheck super.silently;
  58. servant = whenGhcjs dontCheck super.servant;
  59. servant-client = whenGhcjs dontCheck super.servant-client;
  60. servant-server = whenGhcjs dontCheck super.servant-server;
  61. unix-time = whenGhcjs dontCheck super.unix-time;
  62. wai-app-static = whenGhcjs dontCheck super.wai-app-static;
  63. wai-extra = whenGhcjs dontCheck super.wai-extra;
  64.  
  65. foundation = pkgs.lib.flip whenGhcjs super.foundation (package: overrideCabal package (drv: {
  66. postPatch = (drv.postPatch or "") + pkgs.lib.optionalString (system == "x86_64-darwin") ''
  67. substituteInPlace foundation.cabal --replace 'if os(linux)' 'if os(linux) && !impl(ghcjs)'
  68. substituteInPlace foundation.cabal --replace 'if os(osx)' 'if os(linux) && impl(ghcjs)'
  69. '';
  70. }));
  71.  
  72. algebraic-graphs = dontCheck super.algebraic-graphs;
  73.  
  74. # Prevent: "Setup: Encountered missing dependencies: doctest >=0.9"
  75. prettyprinter = dontCheck super.prettyprinter;
  76. prettyprinter-ansi-terminal = dontCheck super.prettyprinter-ansi-terminal;
  77. prettyprinter-convert-ansi-wl-pprint = dontCheck super.prettyprinter-convert-ansi-wl-pprint;
  78.  
  79. # Needed to get around a requirement on `hspec-discover`.
  80. megaparsec = dontCheck super.megaparsec;
  81.  
  82. hedgehog = self.callCabal2nix "hedgehog" (pkgs.fetchFromGitHub {
  83. owner = "hedgehogqa";
  84. repo = "haskell-hedgehog";
  85. rev = "38146de29c97c867cff52fb36367ff9a65306d76";
  86. sha256 = "1z8d3hqrgld1z1fvjd0czksga9lma83caa2fycw0a5gfbs8sh4zh";
  87. } + "/hedgehog") {};
  88. hlint = self.callHackage "hlint" "2.0.14" {};
  89. # hoogle = self.callHackage "hoogle" "5.0.15" {};
  90.  
  91. # sbv 8.1
  92. sbv = dontCheck (self.callCabal2nix "sbv" (pkgs.fetchFromGitHub {
  93. owner = "LeventErkok";
  94. repo = "sbv";
  95. rev = "365b1a369a2550d6284608df3fbc17e2663c4d3c";
  96. sha256 = "134f148g28dg7b3c1rvkh85pfl9pdlvrvl6al4vlz72f3y5mb2xg";
  97. }) {});
  98.  
  99. # need crackNum 2.3
  100. crackNum = pkgs.haskell.lib.dontCheck (self.callCabal2nix "crackNum" (pkgs.fetchFromGitHub {
  101. owner = "LeventErkok";
  102. repo = "crackNum";
  103. rev = "54cf70861a921062db762b3c50e933e73446c3b2";
  104. sha256 = "02cg64rq8xk7x53ziidljyv3gsshdpgbzy7h03r869gj02l7bxwa";
  105. }) {});
  106.  
  107. # Our own custom fork
  108. thyme = dontCheck (self.callCabal2nix "thyme" (pkgs.fetchFromGitHub {
  109. owner = "kadena-io";
  110. repo = "thyme";
  111. rev = "6ee9fcb026ebdb49b810802a981d166680d867c9";
  112. sha256 = "09fcf896bs6i71qhj5w6qbwllkv3gywnn5wfsdrcm0w1y6h8i88f";
  113. }) {});
  114.  
  115. # weeder = self.callHackage "weeder" "1.0.5" {};
  116. weeder = self.callCabal2nix "weeder" (pkgs.fetchFromGitHub {
  117. owner = "ndmitchell";
  118. repo = "weeder";
  119. rev = "56b46fe97782e86198f31c574ac73c8c966fee05";
  120. sha256 = "005ks2xjkbypq318jd0s4896b9wa5qg3jf8a1qgd4imb4fkm3yh7";
  121. }) {};
  122.  
  123. # aeson 1.4.2
  124. aeson = (if self.ghc.isGhcjs or false
  125. then (pkgs.lib.flip addBuildDepend self.hashable-time)
  126. else pkgs.lib.id) (self.callCabal2nix "aeson" (pkgs.fetchFromGitHub {
  127. owner = "bos";
  128. repo = "aeson";
  129. rev = "c3d04181eb64393d449a68084ffea3a94c3d8064";
  130. sha256 = "1l8lks6plj0naj9ghasmkqglshxym3f29gyybvjvkrkm770p2gl4";
  131. }) {});
  132. };
  133. packages = {
  134. pact = gitignore.gitignoreSource [".git" ".gitlab-ci.yml" "CHANGELOG.md" "README.md"] ./.;
  135. };
  136. shellToolOverrides = ghc: super: {
  137. z3 = pkgs.z3;
  138. stack = pkgs.stack;
  139. };
  140. shells = {
  141. ghc = ["pact"];
  142. ghcjs = ["pact"];
  143. };
  144.  
  145. })
RAW Paste Data