git.iko.soy/typeable/stackage2nix
on master help sign in
Update README
089d4f1Dmitry Bushev
README.md+15−13
@@ -4,18 +4,18 @@
4
4
5`stackage2nix` converts a Stack file into a Nix Haskell packages set.
5`stackage2nix` converts a Stack file into a Nix Haskell packages set.
6
6
7−# Create Nix build from stack.yaml
7+# Create build derivation from stack.yaml
8
8
9## Generate targets from stack.yaml only
9## Generate targets from stack.yaml only
10
10
11```
11```
12−stackage2nix .
12+stack exec -- stackage2nix .
13```
13```
14
14
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.
19
19
20Build package with overlay installed:
20Build package with overlay installed:
21
21
@@ -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.
30
30
31``` bash
31``` bash
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
37```
37```
38
38
@@ -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.
44
44
45+### stackage2nix wrapper
46+
45You can use stackage2nix wrapper from `nix` directory that adds required flags:
47You can use stackage2nix wrapper from `nix` directory that adds required flags:
46
48
47```
49```
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
50```
52```
51
53
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`
54
56
55## Generate full Stackage
57## Generate full Stackage
56
58
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`
59
61
60```
62```
@@ -64,7 +66,7 @@ stackage2nix --with-stackage ./stack.yaml
64
66
65## Generate Stackage from LTS resolver
67## Generate Stackage from LTS resolver
66
68
67−You can also generate only Stackage packages from the resolver:
69+You can also generate only Stackage packages set from the resolver:
68
70
69```
71```
70nix-env -i -f ./nix/stackage2nix
72nix-env -i -f ./nix/stackage2nix
@@ -72,7 +74,7 @@ stackage2nix --resolver lts-10.0
72```
74```
73
75
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`.
76
78
77## Runtime dependencies
79## Runtime dependencies
78
80
@@ -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`.
90
92
91−```
93+``` nix
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
109
111
110Integration tests that build stackage2nix form different yaml configs:
112Integration tests that build stackage2nix form different yaml configs:
111
113
112−```
114+``` bash
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 \