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