ed6ecacf64
This change is effectively a no-op to nixpkgs. However, it gives users the flexibility to create and maintain their own package sets per project, while benefiting from nix's Haskell configurations. I would make immediate use of this change in stack2nix, a project that generates nix expressions for all the dependencies of a given Haskell project. @domenkozar is familiar with the motivations and helped refine this change
29 lines
780 B
Nix
29 lines
780 B
Nix
{ pkgs, stdenv, ghc, all-cabal-hashes
|
|
, compilerConfig ? (self: super: {})
|
|
, packageSetConfig ? (self: super: {})
|
|
, overrides ? (self: super: {})
|
|
, initialPackages ? import ./hackage-packages.nix
|
|
}:
|
|
|
|
let
|
|
|
|
inherit (stdenv.lib) extends makeExtensible;
|
|
inherit (import ./lib.nix { inherit pkgs; }) overrideCabal makePackageSet;
|
|
|
|
haskellPackages = makePackageSet {
|
|
package-set = initialPackages;
|
|
inherit ghc;
|
|
};
|
|
|
|
commonConfiguration = import ./configuration-common.nix { inherit pkgs; };
|
|
nixConfiguration = import ./configuration-nix.nix { inherit pkgs; };
|
|
|
|
in
|
|
|
|
makeExtensible
|
|
(extends overrides
|
|
(extends packageSetConfig
|
|
(extends compilerConfig
|
|
(extends commonConfiguration
|
|
(extends nixConfiguration haskellPackages)))))
|