From 2862d272a606c6188c4c33dab60de4e0066ee194 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Sat, 11 Jun 2016 19:21:19 +0200 Subject: [PATCH] haskell: add support for all of Hackage The function "callHackage " generates build instructions for the requested library version on-the-fly. All of Hackage is available. Note: this code is brand-new, experimental, and it might change in the future. Don't base production code on this feature yet. Example usage: $ nix-shell -p 'haskellPackages.callHackage "cpphs" "1.19.3" {}' --run "cpphs --version" cpphs 1.19.3 $ nix-shell -p 'haskellPackages.ghcWithPackages (self: [(self.callHackage "hsdns" "1.6.1" {})])' --run "ghc-pkg list hsdns" /nix/store/p6r81k2vb2pzy4wcvri6z9m492i0hg63-ghc-8.0.1/lib/ghc-8.0.1/package.conf.d hsdns-1.6.1 --- pkgs/development/haskell-modules/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/haskell-modules/default.nix b/pkgs/development/haskell-modules/default.nix index 27f3ccd97328..7a51a1de1471 100644 --- a/pkgs/development/haskell-modules/default.nix +++ b/pkgs/development/haskell-modules/default.nix @@ -8,6 +8,8 @@ let inherit (stdenv.lib) fix' extends; + inherit (import ./lib.nix { inherit pkgs; }) hackage2nix; + haskellPackages = self: let @@ -57,6 +59,8 @@ let inherit mkDerivation callPackage; + callHackage = name: version: self.callPackage (hackage2nix name version); + ghcWithPackages = selectFrom: withPackages (selectFrom self); ghcWithHoogle = selectFrom: