@@ -35,41 +35,23 @@ let
38−Next we will use this to import `haskell.nix`, `hackage.nix` and
38+Next we will use this to import `haskell.nix`.
39−`stackage.nix` (if we use a stack project).
41**NOTE**: update the `rev` and `sha256` values to the recent ones as
40**NOTE**: update the `rev` and `sha256` values to the recent ones as
42− found on GitHub. Especially `hackage.nix` and `stackage.nix` will
41+ found on GitHub. Especially `haskell.hackage` and `haskell.stackage`
43− evolve with package release on hackage and stackage releases
42+ will evolve with package release on hackage and stackage releases
44 respectively.
43 respectively.
48− # all packages from hackage as nix expressions
49− hackage = import (overrideWith "hackage"
50− (pkgs.fetchFromGitHub { owner = "input-output-hk";
47+ haskellLib = pkgs.fetchFromGitHub {
51− repo = "hackage.nix";
52− rev = "3180384b563ec7c7b46bca86b3ace0f32d04cde8";
53− sha256 = "19ndkn8pivli9plwq0wnx1cj126l89yk7jw9a0dj51ic3b2qhlb2";
54− name = "hackage-exprs-source"; }))
56− # a different haskell infrastructure
57− haskell = import (overrideWith "haskell"
58− (pkgs.fetchFromGitHub { owner = "input-output-hk";
48+ owner = "input-output-hk";
59− repo = "haskell.nix";
49+ repo = "haskell.nix";
60− rev = "73f733ba8bbd11443dda713d1a2d4b7c50a5d408";
50+ rev = "5180ae9d78756509c81b98b8e6d974e350b15752";
61− sha256 = "1p2srrxw2lac5krrg35waa251by98r2miwyg6zac9glpg2vmq3ip";
51+ sha256 = "0fbnnvymdp2qb09wlqy6ga8wsyhglx607cjdfg510s1gs756v9yx";
62− name = "haskell-lib-source"; }))
52+ name = "haskell-lib-source";
65− # the set of all stackage snapshots
66− stackage = import (overrideWith "stackage"
54+ haskell = import (overrideWith "haskell" haskellLib) { inherit pkgs; };
67− (pkgs.fetchFromGitHub { owner = "input-output-hk";
68− repo = "stackage.nix";
69− rev = "2615a4e6b1651215ee400e62fcdcb195062a3d35";
70− sha256 = "08c8lb8x047hndwm1cb2zxixnjmrswfp5y18xp1v79cjqlva0qj6";
71− name = "stackage-snapshot-source"; }))
@@ -78,10 +60,17 @@ Finally we string this together and produce a package set:
80 # Import the file you will create in the stack-to-nix or cabal-to-nix step.
62 # Import the file you will create in the stack-to-nix or cabal-to-nix step.
81− my-pkgs = import ./nix/pkgs.nix { inherit stackage; };
63+ my-pkgs = import ./nix/pkgs.nix;
65+ # Stack projects use the mkStackPkgSet helper function
66+ pkgSet = haskell.mkStackPkgSet {
67+ stack-pkgs = my-pkgs;
68+ pkg-def-overlays = [];
72+ # Cabal projects use mkPkgSet
83 pkgSet = haskell.mkPkgSet {
73 pkgSet = haskell.mkPkgSet {
85 pkg-def = my-pkgs.pkg-def;
74 pkg-def = my-pkgs.pkg-def;
86 pkg-def-overlays = [
75 pkg-def-overlays = [
87 # this overlay will provide additional packages
76 # this overlay will provide additional packages