@@ -222,19 +222,27 @@ in package-set { inherit pkgs stdenv callPackage; } self // {
222222 # , modifier : Defaulted
223223 # , returnShellEnv : Defaulted
224224 # , withHoogle : Defaulted
225+ # , cabal2nixOptions : Defaulted
225226 # } -> NixShellAwareDerivation
227+ #
226228 # Given a path to a haskell package directory, an optional package name
227229 # which defaults to the base name of the path, an optional set of source
228230 # overrides as appropriate for the 'packageSourceOverrides' function, an
229231 # optional set of arbitrary overrides, and an optional haskell package
230232 # modifier, return a derivation appropriate for nix-build or nix-shell to
231233 # build that package.
234+ #
232235 # If 'returnShellEnv' is true this returns a derivation which will give you
233236 # an environment suitable for developing the listed packages with an
234237 # incremental tool like cabal-install.
238+ #
235239 # If 'withHoogle' is true (the default if a shell environment is requested)
236240 # then 'ghcWithHoogle' is used to generate the derivation (instead of
237241 # 'ghcWithPackages'), see the documentation there for more information.
242+ #
243+ # 'cabal2nixOptions' can contain extra command line arguments to pass to
244+ # 'cabal2nix' when generating the package derivation, for example setting
245+ # a cabal flag with '--flag=myflag'.
238246 developPackage =
239247 { root
240248 , name ? builtins.baseNameOf root
@@ -242,13 +250,14 @@ in package-set { inherit pkgs stdenv callPackage; } self // {
242250 , overrides ? self: super: {}
243251 , modifier ? drv: drv
244252 , returnShellEnv ? pkgs.lib.inNixShell
245− , withHoogle ? returnShellEnv }:
253+ , withHoogle ? returnShellEnv
254+ , cabal2nixOptions ? "" }:
246255 let drv =
247256 (extensible-self.extend
248257 (pkgs.lib.composeExtensions
249258 (self.packageSourceOverrides source-overrides)
250259 overrides))
251− .callCabal2nix name root {};
260+ .callCabal2nixWithOptions name root cabal2nixOptions {};
252261 in if returnShellEnv
253262 then (modifier drv).envFunc {inherit withHoogle;}
254263 else modifier drv;