on iko/ghcjs-patch-master help sign in
docs: Update stack-to-nix usage

It changed in input-output-hk/nix-tools#29. Closes #72

commit414bcabcca221048244cd5e6a11006776b523fc0 authorRodney Lorrimar <rodney.lorrimar@iohk.io> dateTue 26 Feb 2019, 12:48 (8 years ago) parent2956c80
1 file changed+20−9
docs/user-guide-stack.md+20−9
docs/user-guide-stack.md+20−9
@@ -10,10 +10,10 @@ With [nix-tools](https://github.com/input-output-hk/nix-tools) in
1010`PATH`, we can simply run the following command on a stack project:
1111
1212```bash
13−stack-to-nix -o nix stack.yaml > nix/.stack-pkgs.nix
13+stack-to-nix -o nix --stack-yaml stack.yaml
1414```
1515
16−This will produce a `nix/.stack-pkgs.nix` file that looks like the following:
16+This will produce a `nix/pkgs.nix` file that looks like the following:
1717```nix
1818{
1919 resolver = "lts-12.17";
@@ -23,7 +23,7 @@ This will produce a `nix/.stack-pkgs.nix` file that looks like the following:
2323 "o-clock" = hackage.o-clock."0.1.1".revisions.default;
2424 ...
2525 } // {
26− my-package = ./.stack.nix/my-package.nix;
26+ my-package = ./my-package.nix;
2727 ...
2828 };
2929 };
@@ -35,15 +35,26 @@ packages. The overlay specifies which `extra-deps` (here: clock-0.1.1)
3535we wanted to overlay over the stackage snapshot, and what local
3636packages we want (here: my-package).
3737
38−We will then create the following `nix/pkgs.nix` file:
38+We will then create the following `nix/default.nix` file:
3939
4040```nix
41−let stack-pkgs = import ./.stack-pkgs.nix; in
42−{ stackage, ... }:
43−{ pkg-def = stackage.${stack-pkgs.resolver};
44− inherit (stack-pkgs) overlay;
45−}
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
4654```
4755
56+This generated file is a template, so you can customize it as
57+necessary.
58+
4859*If you came here from the [User Guide](/user-guide), go back and
4960 complete the setup.*