on 6e720ed help sign in
haskell.nix/docs/user-guide-stack.md
39 lines 1.0 kB history raw
1# User Guide (stack project)
3Here we will look into how to generate the `pkgs.nix` file for a
4`stack.yaml` project. For the full integration please see the [User
5Guide](/user-guide)
7## Using `stack-to-nix`
9With [nix-tools](https://github.com/input-output-hk/nix-tools) in
10`PATH`, we can simply run the following command on a stack project:
12```bash
13stack-to-nix -o nix --stack-yaml stack.yaml
14```
16This will produce a `nix/pkgs.nix` file that looks like the following:
17```nix
19 resolver = "lts-12.17";
20 extras = hackage:
21 {
22 packages = {
23 "o-clock" = hackage.o-clock."0.1.1".revisions.default;
24 ...
25 } // {
26 my-package = ./my-package.nix;
27 ...
28 };
29 };
31```
33This file contains the stackage resolver, as well as set of extra
34packages. The extras specifies which `extra-deps` (here: o-clock-0.1.1)
35we wanted to add over the stackage snapshot, and what local
36packages we want (here: my-package).
38*If you came here from the [User Guide](/user-guide), go back and
39 complete the setup.*