on iko/ghcjs-patch-master help sign in
Add `stack-nix` to `stackProject` (#293)
63fc8beHamish Mackenzie
overlays/haskell.nix+13−5
@@ -310,7 +310,7 @@ self: super: {
310 modules = (args.modules or [])
310 modules = (args.modules or [])
311 ++ self.lib.optional (args ? ghc) { ghc.package = args.ghc; };
311 ++ self.lib.optional (args ? ghc) { ghc.package = args.ghc; };
312 };
312 };
313− in {inherit (pkg-set.config) hsPkgs; plan-nix = plan.nix; };
313+ in { inherit (pkg-set.config) hsPkgs; plan-nix = plan.nix; };
314
314
315 cabalProject = args: let p = cabalProject' args;
315 cabalProject = args: let p = cabalProject' args;
316 in p.hsPkgs // {
316 in p.hsPkgs // {
@@ -320,17 +320,25 @@ self: super: {
320 shells.ghc = p.hsPkgs.shellFor {};
320 shells.ghc = p.hsPkgs.shellFor {};
321 };
321 };
322
322
323− stackProject =
323+ stackProject' =
324 { ... }@args:
324 { ... }@args:
325− let stack-pkgs = (importAndFilterProject (callStackToNix args)).pkgs;
325+ let stack = importAndFilterProject (callStackToNix args);
326 in let pkg-set = mkStackPkgSet
326 in let pkg-set = mkStackPkgSet
327− { inherit stack-pkgs;
327+ { stack-pkgs = stack.pkgs;
328 pkg-def-extras = (args.pkg-def-extras or []);
328 pkg-def-extras = (args.pkg-def-extras or []);
329 modules = (args.modules or [])
329 modules = (args.modules or [])
330 ++ self.lib.optional (args ? ghc) { ghc.package = args.ghc; }
330 ++ self.lib.optional (args ? ghc) { ghc.package = args.ghc; }
331 ++ self.lib.optional (args ? cache) (mkCacheModule args.cache);
331 ++ self.lib.optional (args ? cache) (mkCacheModule args.cache);
332 };
332 };
333− in pkg-set.config.hsPkgs;
333+ in { inherit (pkg-set.config) hsPkgs; stack-nix = stack.nix; };
334+
335+ stackProject = args: let p = stackProject' args;
336+ in p.hsPkgs // {
337+ inherit (p) stack-nix;
338+ # Provide `nix-shell -A shells.ghc` for users migrating from the reflex-platform.
339+ # But we should encourage use of `nix-shell -A shellFor`
340+ shells.ghc = p.hsPkgs.shellFor {};
341+ };
334
342
335 # The functions that return a plan-nix often have a lot of dependencies
343 # The functions that return a plan-nix often have a lot of dependencies
336 # that could be GCed and also will not make it into hydra cache.
344 # that could be GCed and also will not make it into hydra cache.