Skip to content

Commit

Permalink
haskellPackages.developPackage: Add overrides argument
Browse files Browse the repository at this point in the history
(cherry picked from commit b349d4b)
  • Loading branch information
shlevy committed Jun 12, 2017
1 parent 1c5f4ae commit d10fe64
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions pkgs/development/haskell-modules/make-package-set.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d10fe64

Please sign in to comment.