@@ -3,3 +3,55 @@
3[](https://travis-ci.org/4e6/stack2nix)
3[](https://travis-ci.org/4e6/stack2nix)
5`stack2nix` converts a single Stack file into a Nix build expression.
5`stack2nix` converts a single Stack file into a Nix build expression.
9+ --lts-haskell "$LTS_HASKELL_REPO" \
10+ --all-cabal-hashes "$ALL_CABAL_HASHES_REPO" \
14+`stack2nix` has three required arguments:
15+- `--lts-haskell` - path to [fpco/lts-haskell](https://github.com/fpco/lts-haskell)
16+- `--all-cabal-hashes` - path to [commercialhaskell/all-cabal-hashes](https://github.com/commercialhaskell/all-cabal-hashes)
17+- `.` - path to stack.yaml file or directory
19+Produced Nix derivation split on following files:
20+- packages.nix - Stackage packages set
21+- configuration-packages.nix - compiler configuration
22+- default.nix - Haskell packages set
24+A particular package from result Haskell packages set can be built with:
27+nix-build -A <package-name>
30+## Override result derivation
32+Complex projects may require some extra customization.
33+Snippet `override.nix` below is a minimal example of Haskell packages override.
36+with import <nixpkgs> {};
37+with pkgs.haskell.lib;
38+let haskellPackages = import ./. {};
39+in haskellPackages.override {
40+ overrides = self: super: {
41+ stack2nix = disableSharedExecutables super.stack2nix;
47+nix-build -A stack2nix override.nix
50+`stack2nix` result derivation is a Haskell packages set, constructed the same way as a default Nix `haskellPackages`.
51+For further details and examples on how to work with Haskell packages in Nix, see Nixpkgs manual [User’s Guide to the Haskell Infrastructure](http://nixos.org/nixpkgs/manual/#users-guide-to-the-haskell-infrastructure)
56+For other examples of `stack2nix` usage, see [4e6/stack2nix-examples](https://github.com/4e6/stack2nix-examples) repository.
57+It checks `stack2nix` execution against different public projects.