From 6a74ba96fdb4c22146ca4672834d3b6df9c46c86 Mon Sep 17 00:00:00 2001 From: Bryan Richter Date: Tue, 14 May 2019 08:18:02 +0300 Subject: [PATCH] Add minimal docs for callHackage and friends Specifically haskellSrc2nix, callHackage, and callHackageDirect. Other functions should probably also be documented, but it's at least a start. --- pkgs/development/haskell-modules/make-package-set.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/haskell-modules/make-package-set.nix b/pkgs/development/haskell-modules/make-package-set.nix index 6b5ecc1df8af..fbe1f991d92e 100644 --- a/pkgs/development/haskell-modules/make-package-set.nix +++ b/pkgs/development/haskell-modules/make-package-set.nix @@ -118,6 +118,7 @@ let inherit packages; }; + # Use cabal2nix to create a default.nix for the package sources found at 'src'. haskellSrc2nix = { name, src, sha256 ? null, extraCabal2nixOptions ? "" }: let sha256Arg = if isNull sha256 then "--sha256=" else ''--sha256="${sha256}"''; @@ -174,8 +175,14 @@ in package-set { inherit pkgs stdenv callPackage; } self // { inherit (haskellLib) packageSourceOverrides; + # callHackage :: Text -> Text -> AttrSet -> HaskellPackage + # + # e.g., while overriding a package set: + # '... foo = self.callHackage "foo" "1.5.3" {}; ...' callHackage = name: version: callPackageKeepDeriver (self.hackage2nix name version); + # callHackageDirect :: Text -> Text -> AttrSet -> HaskellPackage + # # This function does not depend on all-cabal-hashes and therefore will work # for any version that has been released on hackage as opposed to only # versions released before whatever version of all-cabal-hashes you happen