Skip to content

Commit e122281

Browse files
committed
Adds mkCabalProjectPkgsSet
1 parent 3584345 commit e122281

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

default.nix

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,23 @@ let
8282
modules = [ ghcHackagePatches.${compiler.nix-name} ] ++ modules;
8383
};
8484

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+
85102
# Programs for generating Nix expressions from Cabal and Stack
86103
# files.
87104
nix-tools = self.callPackage ./nix-tools {

0 commit comments

Comments
 (0)