@@ -4,18 +4,18 @@
5`stackage2nix` converts a Stack file into a Nix Haskell packages set.
5`stackage2nix` converts a Stack file into a Nix Haskell packages set.
7−# Create Nix build from stack.yaml
7+# Create build derivation from stack.yaml
9## Generate targets from stack.yaml only
9## Generate targets from stack.yaml only
12−stackage2nix .
12+stack exec -- stackage2nix .
15Command creates file `default.nix` which overrides `haskell.packages.stackage`
15Command creates file `default.nix` which overrides `haskell.packages.stackage`
16−packages set. Currently Nixpkgs maintains only Hackage packages, but you can
16+packages set. You should use
17−use [4e6/nixpkgs-stackage](https://github.com/4e6/nixpkgs-stackage) overlay that
17+[typeable/nixpkgs-stackage](https://github.com/typeable/nixpkgs-stackage) overlay that
18−adds LTS Stackage packages.
18+adds LTS Stackage packages to Nixpkgs.
20Build package with overlay installed:
20Build package with overlay installed:
@@ -29,10 +29,10 @@ If you don't want to use Stackage overlay, stackage2nix can generate required
29packages with `--with-stackage-closure` flag.
29packages with `--with-stackage-closure` flag.
32−stackage2nix \
32+stack exec -- stackage2nix \
33 --all-cabal-hashes /path/to/commercialhaskell/all-cabal-hashes \
33 --all-cabal-hashes /path/to/commercialhaskell/all-cabal-hashes \
34 --lts-haskell /path/to/fpco/lts-haskell \
34 --lts-haskell /path/to/fpco/lts-haskell \
35− --with-stackage-closure
35+ --with-stackage-closure \
36 ./stack.yaml
36 ./stack.yaml
@@ -42,11 +42,13 @@ To generate Stackage packages, you should supply additional
42checked out to `hackage` branch and
42checked out to `hackage` branch and
43[fpco/lts-haskell](https://github.com/fpco/lts-haskell) respectively.
43[fpco/lts-haskell](https://github.com/fpco/lts-haskell) respectively.
45+### stackage2nix wrapper
45You can use stackage2nix wrapper from `nix` directory that adds required flags:
47You can use stackage2nix wrapper from `nix` directory that adds required flags:
48nix-env -i -f ./nix/stackage2nix
50nix-env -i -f ./nix/stackage2nix
49−stackage2nix --with-stackage ./stack.yaml
51+stackage2nix --with-stackage-closure ./stack.yaml
52This command will produce `packages.nix` and `configuration-packages.nix`
54This command will produce `packages.nix` and `configuration-packages.nix`
@@ -54,7 +56,7 @@ Stackage packages and its override in `default.nix`
55## Generate full Stackage
57## Generate full Stackage
57−`--with-stackage` parameter generates full Stackage lts in addition to the
59+`--with-stackage` parameter generates full Stackage LTS in addition to the
58targets from `stack.yaml`
60targets from `stack.yaml`
@@ -64,7 +66,7 @@ stackage2nix --with-stackage ./stack.yaml
65## Generate Stackage from LTS resolver
67## Generate Stackage from LTS resolver
67−You can also generate only Stackage packages from the resolver:
69+You can also generate only Stackage packages set from the resolver:
70nix-env -i -f ./nix/stackage2nix
72nix-env -i -f ./nix/stackage2nix
@@ -72,7 +74,7 @@ stackage2nix --resolver lts-10.0
74This command will produce Stackage packages `packages.nix`, packages config
76This command will produce Stackage packages `packages.nix`, packages config
75−`configuration-packages.nix` and a Nix Haskell packages set `default.nix`.
77+`configuration-packages.nix` and a Haskell packages set `default.nix`.
77## Runtime dependencies
79## Runtime dependencies
@@ -88,7 +90,7 @@ Complex projects may require some extra customization.
88Snippet `override.nix` below shows a minimal example of how to apply additional
90Snippet `override.nix` below shows a minimal example of how to apply additional
89overrides on top of Haskell packages set produced by `stackage2nix`.
91overrides on top of Haskell packages set produced by `stackage2nix`.
92with import <nixpkgs> {};
94with import <nixpkgs> {};
93with haskell.lib;
95with haskell.lib;
94let haskellPackages = import ./. {};
96let haskellPackages = import ./. {};
@@ -109,7 +111,7 @@ For more complex overrides and detailed information on how to work with Haskell
110Integration tests that build stackage2nix form different yaml configs:
112Integration tests that build stackage2nix form different yaml configs:
113STACKAGE_REPO=<path/to/stackage/repo> \
115STACKAGE_REPO=<path/to/stackage/repo> \
114ALL_CABAL_HASHES=<path/to/all-cabal-hashes/repo> \
116ALL_CABAL_HASHES=<path/to/all-cabal-hashes/repo> \
115STACK_FILE=stack-ghc-7103.yaml \
117STACK_FILE=stack-ghc-7103.yaml \