1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-03 11:02:05 +00:00
nixpkgs/pkgs/development/haskell-modules/default.nix
Jacob Mitchell ed6ecacf64 haskell-modules: refactor package set
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
2017-05-30 11:27:32 -07:00

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)))))