From b349d4b899a42edcd83cf7057e9d3f1c0833a741 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Mon, 12 Jun 2017 19:29:46 -0400 Subject: [PATCH] haskellPackages.developPackage: Add overrides argument --- .../haskell-modules/make-package-set.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pkgs/development/haskell-modules/make-package-set.nix b/pkgs/development/haskell-modules/make-package-set.nix index f933d6ebfeb9..cc161e3ca2df 100644 --- a/pkgs/development/haskell-modules/make-package-set.nix +++ b/pkgs/development/haskell-modules/make-package-set.nix @@ -129,16 +129,20 @@ in package-set { inherit pkgs stdenv callPackage; } self // { else self.callHackage; in generateExprs name src {}) overrides; - # : { root : Path, source-overrides : Defaulted (Either Path VersionNumber } -> NixShellAwareDerivation + # : { root : Path + # , source-overrides : Defaulted (Either Path VersionNumber + # , overrides : Defaulted (HaskellPackageOverrideSet) + # } -> NixShellAwareDerivation # Given a path to a haskell package directory whose cabal file is - # named the same as the directory name, and an optional set of + # named the same as the directory name, an optional set of # source overrides as appropriate for the 'packageSourceOverrides' - # function, return a derivation appropriate for nix-build or nix-shell + # function, and an optional set of arbitrary overrides, + # return a derivation appropriate for nix-build or nix-shell # to build that package. - developPackage = { root, source-overrides ? {} }: + developPackage = { root, source-overrides ? {}, overrides ? self: super: {} }: let name = builtins.baseNameOf root; drv = - (extensible-self.extend (self.packageSourceOverrides source-overrides)).callCabal2nix name root {}; + (extensible-self.extend (pkgs.lib.composeExtensions (self.packageSourceOverrides source-overrides) overrides)).callCabal2nix name root {}; in if pkgs.lib.inNixShell then drv.env else drv; ghcWithPackages = selectFrom: withPackages (selectFrom self);