git.iko.soy/typeable/stackage2nix
on master help sign in
Update README
commit089d4f14b025936879e32942bb4e5a41a4b55b4f authorDmitry Bushev <bushevdv@gmail.com> dateThu 18 Jan 2018, 21:37 (9 years ago) parent8887ac6
1 file changed+15−13
README.md+15−13
README.md+15−13
@@ -4,18 +4,18 @@
44
55`stackage2nix` converts a Stack file into a Nix Haskell packages set.
66
7−# Create Nix build from stack.yaml
7+# Create build derivation from stack.yaml
88
99## Generate targets from stack.yaml only
1010
1111```
12−stackage2nix .
12+stack exec -- stackage2nix .
1313```
1414
1515Command creates file `default.nix` which overrides `haskell.packages.stackage`
16−packages set. Currently Nixpkgs maintains only Hackage packages, but you can
17−use [4e6/nixpkgs-stackage](https://github.com/4e6/nixpkgs-stackage) overlay that
18−adds LTS Stackage packages.
16+packages set. You should use
17+[typeable/nixpkgs-stackage](https://github.com/typeable/nixpkgs-stackage) overlay that
18+adds LTS Stackage packages to Nixpkgs.
1919
2020Build package with overlay installed:
2121
@@ -29,10 +29,10 @@ If you don't want to use Stackage overlay, stackage2nix can generate required
2929packages with `--with-stackage-closure` flag.
3030
3131``` bash
32−stackage2nix \
32+stack exec -- stackage2nix \
3333 --all-cabal-hashes /path/to/commercialhaskell/all-cabal-hashes \
3434 --lts-haskell /path/to/fpco/lts-haskell \
35− --with-stackage-closure
35+ --with-stackage-closure \
3636 ./stack.yaml
3737```
3838
@@ -42,11 +42,13 @@ To generate Stackage packages, you should supply additional
4242checked out to `hackage` branch and
4343[fpco/lts-haskell](https://github.com/fpco/lts-haskell) respectively.
4444
45+### stackage2nix wrapper
46+
4547You can use stackage2nix wrapper from `nix` directory that adds required flags:
4648
4749```
4850nix-env -i -f ./nix/stackage2nix
49−stackage2nix --with-stackage ./stack.yaml
51+stackage2nix --with-stackage-closure ./stack.yaml
5052```
5153
5254This command will produce `packages.nix` and `configuration-packages.nix`
@@ -54,7 +56,7 @@ Stackage packages and its override in `default.nix`
5456
5557## Generate full Stackage
5658
57−`--with-stackage` parameter generates full Stackage lts in addition to the
59+`--with-stackage` parameter generates full Stackage LTS in addition to the
5860targets from `stack.yaml`
5961
6062```
@@ -64,7 +66,7 @@ stackage2nix --with-stackage ./stack.yaml
6466
6567## Generate Stackage from LTS resolver
6668
67−You can also generate only Stackage packages from the resolver:
69+You can also generate only Stackage packages set from the resolver:
6870
6971```
7072nix-env -i -f ./nix/stackage2nix
@@ -72,7 +74,7 @@ stackage2nix --resolver lts-10.0
7274```
7375
7476This 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`.
7678
7779## Runtime dependencies
7880
@@ -88,7 +90,7 @@ Complex projects may require some extra customization.
8890Snippet `override.nix` below shows a minimal example of how to apply additional
8991overrides on top of Haskell packages set produced by `stackage2nix`.
9092
91−```
93+``` nix
9294with import <nixpkgs> {};
9395with haskell.lib;
9496let haskellPackages = import ./. {};
@@ -109,7 +111,7 @@ For more complex overrides and detailed information on how to work with Haskell
109111
110112Integration tests that build stackage2nix form different yaml configs:
111113
112−```
114+``` bash
113115STACKAGE_REPO=<path/to/stackage/repo> \
114116ALL_CABAL_HASHES=<path/to/all-cabal-hashes/repo> \
115117STACK_FILE=stack-ghc-7103.yaml \