If you use extend to change stuff like the package set, it will remove override, preventing you from doing things like overriding the GHC used, or the all-cabal-hashes. Even if it didn't remove override, I'm guessing the override function installed by nixpkgs.callPackage would operate on the pre-extend object, thus eliminating any extensions added that way.
Fundamentally, I think nixpkgs.callPackage just needs to install an extend function itself, rather than having haskellPackages make its own. It needs to use the self: super: style so that you can extend the package with overrides arbitrarily many times. If it had this, the overrides argument to haskell-modules/default.nix wouldn't be necessary, since it would essentially be a strictly worse version of extend.
$ nix-repl "<nixpkgs>"
nix-repl> ((haskellPackages.extend (self: super: {})).override {}).ghc
error: attribute ‘override’ missing, at (string):1:2
If you use
extendto change stuff like the package set, it will removeoverride, preventing you from doing things like overriding the GHC used, or theall-cabal-hashes. Even if it didn't removeoverride, I'm guessing theoverridefunction installed bynixpkgs.callPackagewould operate on the pre-extendobject, thus eliminating any extensions added that way.Fundamentally, I think
nixpkgs.callPackagejust needs to install anextendfunction itself, rather than havinghaskellPackagesmake its own. It needs to use theself: super:style so that you can extend the package with overrides arbitrarily many times. If it had this, theoverridesargument tohaskell-modules/default.nixwouldn't be necessary, since it would essentially be a strictly worse version ofextend.