summary refs log tree commit diff
path: root/pkgs/development/haskell-modules
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2016-06-11 22:02:47 +0200
committerPeter Simons <simons@cryp.to>2016-06-12 08:37:06 +0200
commit52aad6c77de84daed8fb52534154d1008e0df2bf (patch)
tree4f003f4c5fa58415b8cf5c9d5a1dc1b71cdc94ff /pkgs/development/haskell-modules
parent00bebe798c2c1ebe02d3d191fb7c33e1f23b11d5 (diff)
downloadnixlib-52aad6c77de84daed8fb52534154d1008e0df2bf.tar
nixlib-52aad6c77de84daed8fb52534154d1008e0df2bf.tar.gz
nixlib-52aad6c77de84daed8fb52534154d1008e0df2bf.tar.bz2
nixlib-52aad6c77de84daed8fb52534154d1008e0df2bf.tar.lz
nixlib-52aad6c77de84daed8fb52534154d1008e0df2bf.tar.xz
nixlib-52aad6c77de84daed8fb52534154d1008e0df2bf.tar.zst
nixlib-52aad6c77de84daed8fb52534154d1008e0df2bf.zip
haskell.lib.withHoogle: remove obsolete function
Diffstat (limited to 'pkgs/development/haskell-modules')
-rw-r--r--pkgs/development/haskell-modules/lib.nix23
1 files changed, 21 insertions, 2 deletions
diff --git a/pkgs/development/haskell-modules/lib.nix b/pkgs/development/haskell-modules/lib.nix
index a4db98f2e618..b92bf304723b 100644
--- a/pkgs/development/haskell-modules/lib.nix
+++ b/pkgs/development/haskell-modules/lib.nix
@@ -85,6 +85,25 @@ rec {
 
   triggerRebuild = drv: i: overrideCabal drv (drv: { postUnpack = ": trigger rebuild ${toString i}"; });
 
-  #FIXME: throw this away sometime in the future. added 2015-08-18
-  withHoogle = throw "withHoogle is no longer supported, use ghcWithHoogle instead";
+  allCabalFiles = pkgs.fetchFromGitHub {
+     owner = "commercialhaskell";
+     repo = "all-cabal-hashes";
+     rev = "461610ab6f0cf581e186643c037f1981755792d9";
+     sha256 = "0x2577lfd5cbbaivl72273kw93gcmxvbjybk7w4h2ic3zvs1fnvm";
+   };
+
+   hackage2nix = name: version: pkgs.stdenv.mkDerivation {
+     name = "cabal2nix-${name}-${version}";
+     buildInputs = [ pkgs.cabal2nix ];
+     phases = ["installPhase"];
+     LANG = "en_US.UTF-8";
+     LOCALE_ARCHIVE = pkgs.lib.optionalString pkgs.stdenv.isLinux "${pkgs.glibcLocales}/lib/locale/locale-archive";
+     installPhase = ''
+       export HOME="$TMP"
+       mkdir $out
+       hash=$(sed -e 's/.*"SHA256":"//' -e 's/".*$//' ${allCabalFiles}/${name}/${version}/${name}.json)
+       cabal2nix --sha256=$hash ${allCabalFiles}/${name}/${version}/${name}.cabal >$out/default.nix
+     '';
+   };
+
 }