Skip to content

Instantly share code, notes, and snippets.

@yorickvP
Created December 3, 2019 08:25
Show Gist options
  • Save yorickvP/f88933992a926a411fafc8b16e8fb0c0 to your computer and use it in GitHub Desktop.
Save yorickvP/f88933992a926a411fafc8b16e8fb0c0 to your computer and use it in GitHub Desktop.
{
stackProjectCross = {crossPkgs, pkgs, ...}@args: with crossPkgs.haskell-nix;
let stack = importAndFilterProject (pkgs.haskell-nix.callStackToNix args);
pkg-set = mkStackPkgSet
{ stack-pkgs = stack.pkgs;
pkg-def-extras = (args.pkg-def-extras or []);
modules = (args.modules or [])
++ pkgs.lib.optional (args ? ghc) { ghc.package = args.ghc; }
++ pkgs.lib.optional (args ? cache) (mkCacheModule args.cache);
};
p = { inherit (pkg-set.config) hsPkgs; stack-nix = stack.nix; };
in p.hsPkgs // {
inherit (p) stack-nix;
shells.ghc = p.hsPkgs.shellFor {};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment