on iko/ghcjs-patch-master help sign in
Adds mkCabalProjectPkgsSet
e122281Moritz Angermann
@@ -82,6 +82,23 @@ let
82 modules = [ ghcHackagePatches.${compiler.nix-name} ] ++ modules;
82 modules = [ ghcHackagePatches.${compiler.nix-name} ] ++ modules;
83 };
83 };
84
84
85+ # Create a Haskell package set based on a Cabal configuration.
86+ mkCabalProjectPkgSet =
87+ { plan-pkgs # Path to the output of plan-to-nix
88+ , pkg-def-overlays ? []
89+ , modules ? []
90+ }@args:
91+
92+ let
93+ pkg-def = plan-pkgs.pkgs;
94+ # The compiler referenced in the stack config
95+ compiler = (plan-pkgs.overlay hackage).compiler or (pkg-def hackage).compiler;
96+ in self.mkPkgSet {
97+ inherit pkg-def;
98+ pkg-def-overlays = [ plan-pkgs.overlay ] ++ pkg-def-overlays;
99+ modules = [ ghcHackagePatches.${compiler.nix-name} ] ++ modules;
100+ };
101+
85 # Programs for generating Nix expressions from Cabal and Stack
102 # Programs for generating Nix expressions from Cabal and Stack
86 # files.
103 # files.
87 nix-tools = self.callPackage ./nix-tools {
104 nix-tools = self.callPackage ./nix-tools {