@@ -5,12 +5,14 @@
5or [Stack](https://docs.haskellstack.org/en/stable/README/#quick-start-guide)
5or [Stack](https://docs.haskellstack.org/en/stable/README/#quick-start-guide)
6project and its dependencies into Nix code.
6project and its dependencies into Nix code.
8−Assuming you have [Nix installed](https://nixos.org/download.html), you can start setting up your project.
8+Assuming you have [Nix](https://nixos.org/download.html) installed, you can
9+start setting up your project.
10## Setting up the Cachix binary cache
11## Setting up the Cachix binary cache
12−You can **avoid compiling GHC and nix-tools** by configuring [Cachix](https://cachix.org)
13+You can **avoid compiling GHC and nix-tools** by configuring
13−so you can benefit from the binary cache built by CI:
14+[Cachix](https://cachix.org) so you can benefit from the binary cache built by
16$ nix-env -iA cachix -f https://cachix.org/api/v1/install
18$ nix-env -iA cachix -f https://cachix.org/api/v1/install
@@ -33,13 +35,13 @@ Add `default.nix`:
33{ # Fetch the latest haskell.nix and import its default.nix
35{ # Fetch the latest haskell.nix and import its default.nix
34 haskellNix ? import (builtins.fetchTarball "https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz") {}
36 haskellNix ? import (builtins.fetchTarball "https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz") {}
36−# haskell.nix provides access to the nixpkgs pins which are used by our CI, hence
38+# haskell.nix provides access to the nixpkgs pins which are used by our CI,
37−# you will be more likely to get cache hits when using these.
39+# hence you will be more likely to get cache hits when using these.
38−# But you can also just use your own, e.g. '<nixpkgs>'
40+# But you can also just use your own, e.g. '<nixpkgs>'.
39, nixpkgsSrc ? haskellNix.sources.nixpkgs-2003
41, nixpkgsSrc ? haskellNix.sources.nixpkgs-2003
41−# haskell.nix provides some arguments to be passed to nixpkgs, including some patches
43+# haskell.nix provides some arguments to be passed to nixpkgs, including some
42−# and also the haskell.nix functionality itself as an overlay.
44+# patches and also the haskell.nix functionality itself as an overlay.
43, nixpkgsArgs ? haskellNix.nixpkgsArgs
45, nixpkgsArgs ? haskellNix.nixpkgsArgs
45# import nixpkgs with overlays
47# import nixpkgs with overlays
@@ -84,20 +86,20 @@ cabal new-build your-package-name
85To open a shell for use with `stack` see [the following issue](https://github.com/input-output-hk/haskell.nix/issues/689#issuecomment-643832619).
87To open a shell for use with `stack` see [the following issue](https://github.com/input-output-hk/haskell.nix/issues/689#issuecomment-643832619).
87−### Pinning the [Haskell.nix][] version
89+### Pinning the [haskell.nix][] version
89For simplicity's sake we will use `fetchTarball` for the examples in
91For simplicity's sake we will use `fetchTarball` for the examples in
90this documentation. This will always get the latest version, and is
92this documentation. This will always get the latest version, and is
91similar to an auto-updating Nix channel.
93similar to an auto-updating Nix channel.
93−However, in your own project, you may wish to pin [Haskell.nix][] (as
95+However, in your own project, you may wish to pin [haskell.nix][] (as
94you would pin Nixpkgs). This will make your builds reproducible, more
96you would pin Nixpkgs). This will make your builds reproducible, more
95predictable, and faster (because the fixed version is cached).
97predictable, and faster (because the fixed version is cached).
97−Straightforward way of doing this is to change branch name to a revision.
99+Straightforward way of doing this is to change the branch name to a revision.
100−{ # Fetch the latest haskell.nix and import its default.nix
102+{ # Fetch a specific haskell.nix and import its default.nix
101 haskellNix ? import (builtins.fetchTarball "https://github.com/input-output-hk/haskell.nix/archive/f1a94a4c82a2ab999a67c3b84269da78d89f0075.tar.gz") {}
103 haskellNix ? import (builtins.fetchTarball "https://github.com/input-output-hk/haskell.nix/archive/f1a94a4c82a2ab999a67c3b84269da78d89f0075.tar.gz") {}
@@ -111,4 +113,4 @@ There are other possible schemes for pinning. See
112There are a number of things to explore further in the tutorials section.
114There are a number of things to explore further in the tutorials section.
114−[haskell.nix]: https://github.com/input-output-hk/haskell.nix
116+[haskell.nix]: https://github.com/input-output-hk/haskell.nix