on iko/ghcjs-patch-master help sign in
Merge pull request #77 from input-output-hk/rvl/user-guide-fixes
de64d0cRodney Lorrimar
docs/user-guide-cabal.md−1
@@ -49,7 +49,6 @@ file as follows:
49
49
50```nix
50```nix
51let plan = import ./plan.nix; in
51let plan = import ./plan.nix; in
52−{ ... }:
53{ pkg-def = plan;
52{ pkg-def = plan;
54 overlay =
53 overlay =
55 { local-package-a = ./local-package-a.nix;
54 { local-package-a = ./local-package-a.nix;
docs/user-guide-stack.md−21
@@ -35,26 +35,5 @@ packages. The overlay specifies which `extra-deps` (here: o-clock-0.1.1)
35we wanted to overlay over the stackage snapshot, and what local
35we wanted to overlay over the stackage snapshot, and what local
36packages we want (here: my-package).
36packages we want (here: my-package).
37
37
38−We will then create the following `nix/default.nix` file:
39−
40−```nix
41−{ pkgs ? import <nixpkgs> {} }:
42−
43−let
44− haskell = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz) { inherit pkgs; };
45−
46− pkgSet = haskell.mkStackPkgSet {
47− stack-pkgs = import ./pkgs.nix;
48− pkg-def-overlays = [];
49− modules = [];
50− };
51−
52−in
53− pkgSet.config.hsPkgs
54−```
55−
56−This generated file is a template, so you can customize it as
57−necessary.
58−
59*If you came here from the [User Guide](/user-guide), go back and
38*If you came here from the [User Guide](/user-guide), go back and
60 complete the setup.*
39 complete the setup.*
docs/user-guide.md+20−31
@@ -35,41 +35,23 @@ let
35in
35in
36```
36```
37
37
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).
40
39
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.
45
44
46```nix
45```nix
47let
46let
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"; }))
55− ;
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";
63− hackage;
53+ };
64−
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"; }))
72− ;
73in
55in
74```
56```
75
57
@@ -78,10 +60,17 @@ Finally we string this together and produce a package set:
78```nix
60```nix
79let
61let
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;
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 pkgSet = haskell.mkPkgSet {
73 pkgSet = haskell.mkPkgSet {
84− inherit pkgs;
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