···1111Nixpkgs distributes build instructions for all Haskell packages registered on
1212[Hackage](http://hackage.haskell.org/), but strangely enough normal Nix package
1313lookups don't seem to discover any of them, except for the default version of ghc, cabal-install, and stack:
1414-1515- $ nix-env -i alex
1616- error: selector ‘alex’ matches no derivations
1717- $ nix-env -qa ghc
1818- ghc-7.10.2
1414+```
1515+$ nix-env -i alex
1616+error: selector ‘alex’ matches no derivations
1717+$ nix-env -qa ghc
1818+ghc-7.10.2
1919+```
19202021The Haskell package set is not registered in the top-level namespace because it
2122is *huge*. If all Haskell packages were visible to these commands, then
2223name-based search/install operations would be much slower than they are now. We
2324avoided that by keeping all Haskell-related packages in a separate attribute
2425set called `haskellPackages`, which the following command will list:
2525-2626- $ nix-env -f "<nixpkgs>" -qaP -A haskellPackages
2727- haskellPackages.a50 a50-0.5
2828- haskellPackages.abacate haskell-abacate-0.0.0.0
2929- haskellPackages.abcBridge haskell-abcBridge-0.12
3030- haskellPackages.afv afv-0.1.1
3131- haskellPackages.alex alex-3.1.4
3232- haskellPackages.Allure Allure-0.4.101.1
3333- haskellPackages.alms alms-0.6.7
3434- [... some 8000 entries omitted ...]
2626+```
2727+$ nix-env -f "<nixpkgs>" -qaP -A haskellPackages
2828+haskellPackages.a50 a50-0.5
2929+haskellPackages.abacate haskell-abacate-0.0.0.0
3030+haskellPackages.abcBridge haskell-abcBridge-0.12
3131+haskellPackages.afv afv-0.1.1
3232+haskellPackages.alex alex-3.1.4
3333+haskellPackages.Allure Allure-0.4.101.1
3434+haskellPackages.alms alms-0.6.7
3535+[... some 8000 entries omitted ...]
3636+```
35373638To install any of those packages into your profile, refer to them by their
3739attribute path (first column):
3838-3939- $ nix-env -f "<nixpkgs>" -iA haskellPackages.Allure ...
4040+```shell
4141+nix-env -f "<nixpkgs>" -iA haskellPackages.Allure ...
4242+```
40434144The attribute path of any Haskell packages corresponds to the name of that
4245particular package on Hackage: the package `cabal-install` has the attribute
···5861reach Nixpkgs varies from system to system. We dodged that problem by giving
5962`nix-env` an explicit `-f "<nixpkgs>"` parameter, but if you call `nix-env`
6063without that flag, then chances are the invocation fails:
6161-6262- $ nix-env -iA haskellPackages.cabal-install
6363- error: attribute ‘haskellPackages’ in selection path
6464- ‘haskellPackages.cabal-install’ not found
6464+```
6565+$ nix-env -iA haskellPackages.cabal-install
6666+error: attribute ‘haskellPackages’ in selection path
6767+ ‘haskellPackages.cabal-install’ not found
6868+```
65696670On NixOS, for example, Nixpkgs does *not* exist in the top-level namespace by
6771default. To figure out the proper attribute path, it's easiest to query for the
6872path of a well-known Nixpkgs package, i.e.:
6969-7070- $ nix-env -qaP coreutils
7171- nixos.coreutils coreutils-8.23
7373+```
7474+$ nix-env -qaP coreutils
7575+nixos.coreutils coreutils-8.23
7676+```
72777378If your system responds like that (most NixOS installations will), then the
7479attribute path to `haskellPackages` is `nixos.haskellPackages`. Thus, if you
7580want to use `nix-env` without giving an explicit `-f` flag, then that's the way
7681to do it:
7777-7878- $ nix-env -qaP -A nixos.haskellPackages
7979- $ nix-env -iA nixos.haskellPackages.cabal-install
8282+```shell
8383+nix-env -qaP -A nixos.haskellPackages
8484+nix-env -iA nixos.haskellPackages.cabal-install
8585+```
80868187Our current default compiler is GHC 7.10.x and the `haskellPackages` set
8288contains packages built with that particular version. Nixpkgs contains the
8389latest major release of every GHC since 6.10.4, however, and there is a whole
8490family of package sets available that defines Hackage packages built with each
8591of those compilers, too:
8686-8787- $ nix-env -f "<nixpkgs>" -qaP -A haskell.packages.ghc6123
8888- $ nix-env -f "<nixpkgs>" -qaP -A haskell.packages.ghc763
9292+```shell
9393+nix-env -f "<nixpkgs>" -qaP -A haskell.packages.ghc6123
9494+nix-env -f "<nixpkgs>" -qaP -A haskell.packages.ghc763
9595+```
89969097The name `haskellPackages` is really just a synonym for
9198`haskell.packages.ghc7102`, because we prefer that package set internally and
9299recommend it to our users as their default choice, but ultimately you are free
93100to compile your Haskell packages with any GHC version you please. The following
94101command displays the complete list of available compilers:
9595-9696- $ nix-env -f "<nixpkgs>" -qaP -A haskell.compiler
9797- haskell.compiler.ghc6104 ghc-6.10.4
9898- haskell.compiler.ghc6123 ghc-6.12.3
9999- haskell.compiler.ghc704 ghc-7.0.4
100100- haskell.compiler.ghc722 ghc-7.2.2
101101- haskell.compiler.ghc742 ghc-7.4.2
102102- haskell.compiler.ghc763 ghc-7.6.3
103103- haskell.compiler.ghc784 ghc-7.8.4
104104- haskell.compiler.ghc7102 ghc-7.10.2
105105- haskell.compiler.ghcHEAD ghc-7.11.20150402
106106- haskell.compiler.ghcNokinds ghc-nokinds-7.11.20150704
107107- haskell.compiler.ghcjs ghcjs-0.1.0
108108- haskell.compiler.jhc jhc-0.8.2
109109- haskell.compiler.uhc uhc-1.1.9.0
102102+```
103103+$ nix-env -f "<nixpkgs>" -qaP -A haskell.compiler
104104+haskell.compiler.ghc6104 ghc-6.10.4
105105+haskell.compiler.ghc6123 ghc-6.12.3
106106+haskell.compiler.ghc704 ghc-7.0.4
107107+haskell.compiler.ghc722 ghc-7.2.2
108108+haskell.compiler.ghc742 ghc-7.4.2
109109+haskell.compiler.ghc763 ghc-7.6.3
110110+haskell.compiler.ghc784 ghc-7.8.4
111111+haskell.compiler.ghc7102 ghc-7.10.2
112112+haskell.compiler.ghcHEAD ghc-7.11.20150402
113113+haskell.compiler.ghcNokinds ghc-nokinds-7.11.20150704
114114+haskell.compiler.ghcjs ghcjs-0.1.0
115115+haskell.compiler.jhc jhc-0.8.2
116116+haskell.compiler.uhc uhc-1.1.9.0
117117+```
110118111119We have no package sets for `jhc` or `uhc` yet, unfortunately, but for every
112120version of GHC listed above, there exists a package set based on that compiler.
···121129of the tools `cabal-install` and `stack`. We saw in section
122130[How to install Haskell packages] how you can install those programs into your
123131user profile:
124124-125125- $ nix-env -f "<nixpkgs>" -iA haskellPackages.ghc haskellPackages.cabal-install
132132+```shell
133133+nix-env -f "<nixpkgs>" -iA haskellPackages.ghc haskellPackages.cabal-install
134134+```
126135127136Instead of the default package set `haskellPackages`, you can also use the more
128137precise name `haskell.compiler.ghc7102`, which has the advantage that it refers
···131140132141Once you've made those tools available in `$PATH`, it's possible to build
133142Hackage packages the same way people without access to Nix do it all the time:
134134-135135- $ cabal get lens-4.11 && cd lens-4.11
136136- $ cabal install -j --dependencies-only
137137- $ cabal configure
138138- $ cabal build
143143+```shell
144144+cabal get lens-4.11 && cd lens-4.11
145145+cabal install -j --dependencies-only
146146+cabal configure
147147+cabal build
148148+```
139149140150If you enjoy working with Cabal sandboxes, then that's entirely possible too:
141151just execute the command
142142-143143- $ cabal sandbox init
144144-152152+```shell
153153+cabal sandbox init
154154+```
145155before installing the required dependencies.
146156147157The `nix-shell` utility makes it easy to switch to a different compiler
148158version; just enter the Nix shell environment with the command
149149-150150- $ nix-shell -p haskell.compiler.ghc784
151151-159159+```shell
160160+nix-shell -p haskell.compiler.ghc784
161161+```
152162to bring GHC 7.8.4 into `$PATH`. Alternatively, you can use Stack instead of
153163`nix-shell` directly to select compiler versions and other build tools
154164per-project. It uses `nix-shell` under the hood when Nix support is turned on.
···159169a project that doesn't depend on any additional system libraries outside of GHC,
160170then it's even sufficient to just run the `cabal configure` command inside of
161171the shell:
162162-163163- $ nix-shell -p haskell.compiler.ghc784 --command "cabal configure"
172172+```shell
173173+nix-shell -p haskell.compiler.ghc784 --command "cabal configure"
174174+```
164175165176Afterwards, all other commands like `cabal build` work just fine in any shell
166177environment, because the configure phase recorded the absolute paths to all
···187198GHC. For example, the Nix expression `ghcWithPackages (pkgs: [pkgs.mtl])`
188199generates a copy of GHC that has the `mtl` library registered in addition to
189200its normal core packages:
201201+```
202202+$ nix-shell -p "haskellPackages.ghcWithPackages (pkgs: [pkgs.mtl])"
190203191191- $ nix-shell -p "haskellPackages.ghcWithPackages (pkgs: [pkgs.mtl])"
192192-193193- [nix-shell:~]$ ghc-pkg list mtl
194194- /nix/store/zy79...-ghc-7.10.2/lib/ghc-7.10.2/package.conf.d:
195195- mtl-2.2.1
204204+[nix-shell:~]$ ghc-pkg list mtl
205205+/nix/store/zy79...-ghc-7.10.2/lib/ghc-7.10.2/package.conf.d:
206206+ mtl-2.2.1
207207+```
196208197209This function allows users to define their own development environment by means
198210of an override. After adding the following snippet to `~/.config/nixpkgs/config.nix`,
199199-200200- {
201201- packageOverrides = super: let self = super.pkgs; in
202202- {
203203- myHaskellEnv = self.haskell.packages.ghc7102.ghcWithPackages
204204- (haskellPackages: with haskellPackages; [
205205- # libraries
206206- arrows async cgi criterion
207207- # tools
208208- cabal-install haskintex
209209- ]);
210210- };
211211- }
212212-211211+```nix
212212+{
213213+ packageOverrides = super: let self = super.pkgs; in
214214+ {
215215+ myHaskellEnv = self.haskell.packages.ghc7102.ghcWithPackages
216216+ (haskellPackages: with haskellPackages; [
217217+ # libraries
218218+ arrows async cgi criterion
219219+ # tools
220220+ cabal-install haskintex
221221+ ]);
222222+ };
223223+}
224224+```
213225it's possible to install that compiler with `nix-env -f "<nixpkgs>" -iA
214226myHaskellEnv`. If you'd like to switch that development environment to a
215227different version of GHC, just replace the `ghc7102` bit in the previous
···221233The generated `ghc` program is a wrapper script that re-directs the real
222234GHC executable to use a new `lib` directory --- one that we specifically
223235constructed to contain all those packages the user requested:
224224-225225- $ cat $(type -p ghc)
226226- #! /nix/store/xlxj...-bash-4.3-p33/bin/bash -e
227227- export NIX_GHC=/nix/store/19sm...-ghc-7.10.2/bin/ghc
228228- export NIX_GHCPKG=/nix/store/19sm...-ghc-7.10.2/bin/ghc-pkg
229229- export NIX_GHC_DOCDIR=/nix/store/19sm...-ghc-7.10.2/share/doc/ghc/html
230230- export NIX_GHC_LIBDIR=/nix/store/19sm...-ghc-7.10.2/lib/ghc-7.10.2
231231- exec /nix/store/j50p...-ghc-7.10.2/bin/ghc "-B$NIX_GHC_LIBDIR" "$@"
236236+```
237237+$ cat $(type -p ghc)
238238+#! /nix/store/xlxj...-bash-4.3-p33/bin/bash -e
239239+export NIX_GHC=/nix/store/19sm...-ghc-7.10.2/bin/ghc
240240+export NIX_GHCPKG=/nix/store/19sm...-ghc-7.10.2/bin/ghc-pkg
241241+export NIX_GHC_DOCDIR=/nix/store/19sm...-ghc-7.10.2/share/doc/ghc/html
242242+export NIX_GHC_LIBDIR=/nix/store/19sm...-ghc-7.10.2/lib/ghc-7.10.2
243243+exec /nix/store/j50p...-ghc-7.10.2/bin/ghc "-B$NIX_GHC_LIBDIR" "$@"
244244+```
232245233246The variables `$NIX_GHC`, `$NIX_GHCPKG`, etc. point to the *new* store path
234247`ghcWithPackages` constructed specifically for this environment. The last line
···248261To make sure that mechanism works properly all the time, we recommend that you
249262set those variables to meaningful values in your shell environment, too, i.e.
250263by adding the following code to your `~/.bashrc`:
251251-252252- if type >/dev/null 2>&1 -p ghc; then
253253- eval "$(egrep ^export "$(type -p ghc)")"
254254- fi
264264+```bash
265265+if type >/dev/null 2>&1 -p ghc; then
266266+ eval "$(egrep ^export "$(type -p ghc)")"
267267+fi
268268+```
255269256270If you are certain that you'll use only one GHC environment which is located in
257271your user profile, then you can use the following code, too, which has the
258272advantage that it doesn't contain any paths from the Nix store, i.e. those
259273settings always remain valid even if a `nix-env -u` operation updates the GHC
260274environment in your profile:
261261-262262- if [ -e ~/.nix-profile/bin/ghc ]; then
263263- export NIX_GHC="$HOME/.nix-profile/bin/ghc"
264264- export NIX_GHCPKG="$HOME/.nix-profile/bin/ghc-pkg"
265265- export NIX_GHC_DOCDIR="$HOME/.nix-profile/share/doc/ghc/html"
266266- export NIX_GHC_LIBDIR="$HOME/.nix-profile/lib/ghc-$($NIX_GHC --numeric-version)"
267267- fi
275275+```bash
276276+if [ -e ~/.nix-profile/bin/ghc ]; then
277277+ export NIX_GHC="$HOME/.nix-profile/bin/ghc"
278278+ export NIX_GHCPKG="$HOME/.nix-profile/bin/ghc-pkg"
279279+ export NIX_GHC_DOCDIR="$HOME/.nix-profile/share/doc/ghc/html"
280280+ export NIX_GHC_LIBDIR="$HOME/.nix-profile/lib/ghc-$($NIX_GHC --numeric-version)"
281281+fi
282282+```
268283269284### How to install a compiler with libraries, hoogle and documentation indexes
270285···280295long and scary.
281296282297For example, installing the following environment
283283-284284- {
285285- packageOverrides = super: let self = super.pkgs; in
286286- {
287287- myHaskellEnv = self.haskellPackages.ghcWithHoogle
288288- (haskellPackages: with haskellPackages; [
289289- # libraries
290290- arrows async cgi criterion
291291- # tools
292292- cabal-install haskintex
293293- ]);
294294- };
295295- }
296296-298298+```nix
299299+{
300300+ packageOverrides = super: let self = super.pkgs; in
301301+ {
302302+ myHaskellEnv = self.haskellPackages.ghcWithHoogle
303303+ (haskellPackages: with haskellPackages; [
304304+ # libraries
305305+ arrows async cgi criterion
306306+ # tools
307307+ cabal-install haskintex
308308+ ]);
309309+ };
310310+}
311311+```
297312allows one to browse module documentation index [not too dissimilar to
298313this](https://downloads.haskell.org/~ghc/latest/docs/html/libraries/index.html)
299314for all the specified packages and their dependencies by directing a browser of
···303318304319After you've marveled enough at that try adding the following to your
305320`~/.ghc/ghci.conf`
306306-307307- :def hoogle \s -> return $ ":! hoogle search -cl --count=15 \"" ++ s ++ "\""
308308- :def doc \s -> return $ ":! hoogle search -cl --info \"" ++ s ++ "\""
309309-321321+```
322322+:def hoogle \s -> return $ ":! hoogle search -cl --count=15 \"" ++ s ++ "\""
323323+:def doc \s -> return $ ":! hoogle search -cl --info \"" ++ s ++ "\""
324324+```
310325and test it by typing into `ghci`:
311311-312312- :hoogle a -> a
313313- :doc a -> a
326326+```
327327+:hoogle a -> a
328328+:doc a -> a
329329+```
314330315331Be sure to note the links to `haddock` files in the output. With any modern and
316332properly configured terminal emulator you can just click those links to
317333navigate there.
318334319335Finally, you can run
320320-321321- hoogle server -p 8080
322322-336336+```shell
337337+hoogle server -p 8080
338338+```
323339and navigate to http://localhost:8080/ for your own local
324340[Hoogle](https://www.haskell.org/hoogle/). Note, however, that Firefox and
325341possibly other browsers disallow navigation from `http:` to `file:` URIs for
···334350automatically select the right version of GHC and other build tools to build,
335351test and execute apps in an existing project downloaded from somewhere on the
336352Internet. Pass the `--nix` flag to any `stack` command to do so, e.g.
337337-338338- $ git clone --recursive http://github.com/yesodweb/wai
339339- $ cd wai
340340- $ stack --nix build
353353+```shell
354354+git clone --recursive http://github.com/yesodweb/wai
355355+cd wai
356356+stack --nix build
357357+```
341358342359If you want `stack` to use Nix by default, you can add a `nix` section to the
343360`stack.yaml` file, as explained in the [Stack documentation][stack-nix-doc]. For
344361example:
345345-346346- nix:
347347- enable: true
348348- packages: [pkgconfig zeromq zlib]
362362+```yaml
363363+nix:
364364+ enable: true
365365+ packages: [pkgconfig zeromq zlib]
366366+```
349367350368The example configuration snippet above tells Stack to create an ad hoc
351369environment for `nix-shell` as in the below section, in which the `pkgconfig`,
···356374environments might need to expose Nixpkgs packages compiled in a certain way, or
357375with extra environment variables. In these cases, you'll need a `shell` field
358376instead of `packages`:
359359-360360- nix:
361361- enable: true
362362- shell-file: shell.nix
377377+```yaml
378378+nix:
379379+ enable: true
380380+ shell-file: shell.nix
381381+```
363382364383For more on how to write a `shell.nix` file see the below section. You'll need
365384to express a derivation. Note that Nixpkgs ships with a convenience wrapper
···368387as `mkDerivation` can be provided. For example, to build a Stack project that
369388including packages that link against a version of the R library compiled with
370389special options turned on:
390390+```nix
391391+with (import <nixpkgs> { });
371392372372- with (import <nixpkgs> { });
373373-374374- let R = pkgs.R.override { enableStrictBarrier = true; };
375375- in
376376- haskell.lib.buildStackProject {
377377- name = "HaskellR";
378378- buildInputs = [ R zeromq zlib ];
379379- }
393393+let R = pkgs.R.override { enableStrictBarrier = true; };
394394+in
395395+haskell.lib.buildStackProject {
396396+ name = "HaskellR";
397397+ buildInputs = [ R zeromq zlib ];
398398+}
399399+```
380400381401You can select a particular GHC version to compile with by setting the
382402`ghc` attribute as an argument to `buildStackProject`. Better yet, let
383403Stack choose what GHC version it wants based on the snapshot specified
384404in `stack.yaml` (only works with Stack >= 1.1.3):
405405+```nix
406406+{nixpkgs ? import <nixpkgs> { }, ghc ? nixpkgs.ghc}:
385407386386- {nixpkgs ? import <nixpkgs> { }, ghc ? nixpkgs.ghc}:
408408+with nixpkgs;
387409388388- with nixpkgs;
389389-390390- let R = pkgs.R.override { enableStrictBarrier = true; };
391391- in
392392- haskell.lib.buildStackProject {
393393- name = "HaskellR";
394394- buildInputs = [ R zeromq zlib ];
395395- inherit ghc;
396396- }
410410+let R = pkgs.R.override { enableStrictBarrier = true; };
411411+in
412412+haskell.lib.buildStackProject {
413413+ name = "HaskellR";
414414+ buildInputs = [ R zeromq zlib ];
415415+ inherit ghc;
416416+}
417417+```
397418398419[stack-nix-doc]: http://docs.haskellstack.org/en/stable/nix_integration.html
399420···401422402423The easiest way to create an ad hoc development environment is to run
403424`nix-shell` with the appropriate GHC environment given on the command-line:
404404-405405- nix-shell -p "haskellPackages.ghcWithPackages (pkgs: with pkgs; [mtl pandoc])"
425425+```shell
426426+nix-shell -p "haskellPackages.ghcWithPackages (pkgs: with pkgs; [mtl pandoc])"
427427+```
406428407429For more sophisticated use-cases, however, it's more convenient to save the
408430desired configuration in a file called `shell.nix` that looks like this:
409409-410410- { nixpkgs ? import <nixpkgs> {}, compiler ? "ghc7102" }:
411411- let
412412- inherit (nixpkgs) pkgs;
413413- ghc = pkgs.haskell.packages.${compiler}.ghcWithPackages (ps: with ps; [
414414- monad-par mtl
415415- ]);
416416- in
417417- pkgs.stdenv.mkDerivation {
418418- name = "my-haskell-env-0";
419419- buildInputs = [ ghc ];
420420- shellHook = "eval $(egrep ^export ${ghc}/bin/ghc)";
421421- }
431431+```nix
432432+{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc7102" }:
433433+let
434434+ inherit (nixpkgs) pkgs;
435435+ ghc = pkgs.haskell.packages.${compiler}.ghcWithPackages (ps: with ps; [
436436+ monad-par mtl
437437+ ]);
438438+in
439439+pkgs.stdenv.mkDerivation {
440440+ name = "my-haskell-env-0";
441441+ buildInputs = [ ghc ];
442442+ shellHook = "eval $(egrep ^export ${ghc}/bin/ghc)";
443443+}
444444+```
422445423446Now run `nix-shell` --- or even `nix-shell --pure` --- to enter a shell
424447environment that has the appropriate compiler in `$PATH`. If you use `--pure`,
···434457environment suitable for compiling that particular package. If you'd like to
435458hack the `lens` library, for example, then you just have to check out the
436459source code and enter the appropriate environment:
460460+```
461461+$ cabal get lens-4.11 && cd lens-4.11
462462+Downloading lens-4.11...
463463+Unpacking to lens-4.11/
437464438438- $ cabal get lens-4.11 && cd lens-4.11
439439- Downloading lens-4.11...
440440- Unpacking to lens-4.11/
441441-442442- $ nix-shell "<nixpkgs>" -A haskellPackages.lens.env
443443- [nix-shell:/tmp/lens-4.11]$
465465+$ nix-shell "<nixpkgs>" -A haskellPackages.lens.env
466466+[nix-shell:/tmp/lens-4.11]$
467467+```
444468445469At point, you can run `cabal configure`, `cabal build`, and all the other
446470development commands. Note that you need `cabal-install` installed in your
···459483For example, let's assume that you're working on a private project called
460484`foo`. To generate a Nix build expression for it, change into the project's
461485top-level directory and run the command:
462462-463463- $ cabal2nix . >foo.nix
464464-486486+```shell
487487+cabal2nix . > foo.nix
488488+```
465489Then write the following snippet into a file called `default.nix`:
466466-467467- { nixpkgs ? import <nixpkgs> {}, compiler ? "ghc7102" }:
468468- nixpkgs.pkgs.haskell.packages.${compiler}.callPackage ./foo.nix { }
490490+```nix
491491+{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc7102" }:
492492+nixpkgs.pkgs.haskell.packages.${compiler}.callPackage ./foo.nix { }
493493+```
469494470495Finally, store the following code in a file called `shell.nix`:
471471-472472- { nixpkgs ? import <nixpkgs> {}, compiler ? "ghc7102" }:
473473- (import ./default.nix { inherit nixpkgs compiler; }).env
496496+```nix
497497+{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc7102" }:
498498+(import ./default.nix { inherit nixpkgs compiler; }).env
499499+```
474500475501At this point, you can run `nix-build` to have Nix compile your project and
476502install it into a Nix store path. The local directory will contain a symlink
···486512487513If your package does not depend on any system-level libraries, then it's
488514sufficient to run
489489-490490- $ nix-shell --command "cabal configure"
491491-515515+```shell
516516+nix-shell --command "cabal configure"
517517+```
492518once to set up your build. `cabal-install` determines the absolute paths to all
493519resources required for the build and writes them into a config file in the
494520`dist/` directory. Once that's done, you can run `cabal build` and any other
···502528up a `default.nix` and `shell.nix` file manually, then you can use the
503529`--shell` flag offered by `cabal2nix` to have it generate a stand-alone
504530`nix-shell` environment for you. With that feature, running
505505-506506- $ cabal2nix --shell . >shell.nix
507507- $ nix-shell --command "cabal configure"
508508-531531+```shell
532532+cabal2nix --shell . > shell.nix
533533+nix-shell --command "cabal configure"
534534+```
509535is usually enough to set up a build environment for any given Haskell package.
510536You can even use that generated file to run `nix-build`, too:
511511-512512- $ nix-build shell.nix
537537+```shell
538538+nix-build shell.nix
539539+```
513540514541### How to build projects that depend on each other
515542···518545for the dependency resolution performed by `callPackage`. First of all, change
519546into each of your projects top-level directories and generate a `default.nix`
520547file with `cabal2nix`:
521521-522522- $ cd ~/src/foo && cabal2nix . >default.nix
523523- $ cd ~/src/bar && cabal2nix . >default.nix
524524-548548+```shell
549549+cd ~/src/foo && cabal2nix . > default.nix
550550+cd ~/src/bar && cabal2nix . > default.nix
551551+```
525552Then edit your `~/.config/nixpkgs/config.nix` file to register those builds in the
526553default Haskell package set:
527527-528528- {
529529- packageOverrides = super: let self = super.pkgs; in
530530- {
531531- haskellPackages = super.haskellPackages.override {
532532- overrides = self: super: {
533533- foo = self.callPackage ../src/foo {};
534534- bar = self.callPackage ../src/bar {};
535535- };
536536- };
537537- };
538538- }
539539-554554+```nix
555555+{
556556+ packageOverrides = super: let self = super.pkgs; in
557557+ {
558558+ haskellPackages = super.haskellPackages.override {
559559+ overrides = self: super: {
560560+ foo = self.callPackage ../src/foo {};
561561+ bar = self.callPackage ../src/bar {};
562562+ };
563563+ };
564564+ };
565565+}
566566+```
540567Once that's accomplished, `nix-env -f "<nixpkgs>" -qA haskellPackages` will
541568show your packages like any other package from Hackage, and you can build them
542542-543543- $ nix-build "<nixpkgs>" -A haskellPackages.foo
544544-569569+```shell
570570+nix-build "<nixpkgs>" -A haskellPackages.foo
571571+```
545572or enter an interactive shell environment suitable for building them:
546546-547547- $ nix-shell "<nixpkgs>" -A haskellPackages.bar.env
573573+```shell
574574+nix-shell "<nixpkgs>" -A haskellPackages.bar.env
575575+```
548576549577## Miscellaneous Topics
550578···555583feature is to replace the default `mkDerivation` function with one that enables
556584library profiling for all packages. To accomplish that, add configure the
557585following snippet in your `~/.config/nixpkgs/config.nix` file:
558558-559559- {
560560- packageOverrides = super: let self = super.pkgs; in
561561- {
562562- profiledHaskellPackages = self.haskellPackages.override {
563563- overrides = self: super: {
564564- mkDerivation = args: super.mkDerivation (args // {
565565- enableLibraryProfiling = true;
566566- });
567567- };
568568- };
586586+```nix
587587+{
588588+ packageOverrides = super: let self = super.pkgs; in
589589+ {
590590+ profiledHaskellPackages = self.haskellPackages.override {
591591+ overrides = self: super: {
592592+ mkDerivation = args: super.mkDerivation (args // {
593593+ enableLibraryProfiling = true;
594594+ });
569595 };
570570- }
571571-596596+ };
597597+ };
598598+}
599599+```
572600Then, replace instances of `haskellPackages` in the `cabal2nix`-generated
573601`default.nix` or `shell.nix` files with `profiledHaskellPackages`.
574602···5806087.8.4 cannot compile that binary. Now, one way to solve that problem is to
581609register an older version of `ghc-events` in the 7.8.x-specific package set.
582610The first step is to generate Nix build instructions with `cabal2nix`:
583583-584584- $ cabal2nix cabal://ghc-events-0.4.3.0 >~/.nixpkgs/ghc-events-0.4.3.0.nix
585585-611611+```shell
612612+cabal2nix cabal://ghc-events-0.4.3.0 > ~/.nixpkgs/ghc-events-0.4.3.0.nix
613613+```
586614Then add the override in `~/.config/nixpkgs/config.nix`:
587587-588588- {
589589- packageOverrides = super: let self = super.pkgs; in
590590- {
591591- haskell = super.haskell // {
592592- packages = super.haskell.packages // {
593593- ghc784 = super.haskell.packages.ghc784.override {
594594- overrides = self: super: {
595595- ghc-events = self.callPackage ./ghc-events-0.4.3.0.nix {};
596596- };
597597- };
615615+```nix
616616+{
617617+ packageOverrides = super: let self = super.pkgs; in
618618+ {
619619+ haskell = super.haskell // {
620620+ packages = super.haskell.packages // {
621621+ ghc784 = super.haskell.packages.ghc784.override {
622622+ overrides = self: super: {
623623+ ghc-events = self.callPackage ./ghc-events-0.4.3.0.nix {};
598624 };
599625 };
600626 };
601601- }
627627+ };
628628+ };
629629+}
630630+```
602631603632This code is a little crazy, no doubt, but it's necessary because the intuitive
604633version
634634+```nix
635635+{ # ...
605636606606- haskell.packages.ghc784 = super.haskell.packages.ghc784.override {
607607- overrides = self: super: {
608608- ghc-events = self.callPackage ./ghc-events-0.4.3.0.nix {};
609609- };
637637+ haskell.packages.ghc784 = super.haskell.packages.ghc784.override {
638638+ overrides = self: super: {
639639+ ghc-events = self.callPackage ./ghc-events-0.4.3.0.nix {};
610640 };
611611-641641+ };
642642+}
643643+```
612644doesn't do what we want it to: that code replaces the `haskell` package set in
613645Nixpkgs with one that contains only one entry,`packages`, which contains only
614646one entry `ghc784`. This override loses the `haskell.compiler` set, and it
···618650619651Once it's accomplished, however, we can install a variant of `ghc-events`
620652that's compiled with GHC 7.8.4:
621621-622622- nix-env -f "<nixpkgs>" -iA haskell.packages.ghc784.ghc-events
623623-653653+```shell
654654+nix-env -f "<nixpkgs>" -iA haskell.packages.ghc784.ghc-events
655655+```
624656Unfortunately, it turns out that this build fails again while executing the
625657test suite! Apparently, the release archive on Hackage is missing some data
626658files that the test suite requires, so we cannot run it. We accomplish that by
627659re-generating the Nix expression with the `--no-check` flag:
628628-629629- $ cabal2nix --no-check cabal://ghc-events-0.4.3.0 >~/.nixpkgs/ghc-events-0.4.3.0.nix
630630-660660+```shell
661661+cabal2nix --no-check cabal://ghc-events-0.4.3.0 > ~/.nixpkgs/ghc-events-0.4.3.0.nix
662662+```
631663Now the builds succeeds.
632664633665Of course, in the concrete example of `ghc-events` this whole exercise is not
···642674643675GHC and distributed build farms don't get along well:
644676645645- https://ghc.haskell.org/trac/ghc/ticket/4012
677677+ - https://ghc.haskell.org/trac/ghc/ticket/4012
646678647679When you see an error like this one
648648-649649- package foo-0.7.1.0 is broken due to missing package
650650- text-1.2.0.4-98506efb1b9ada233bb5c2b2db516d91
651651-680680+```
681681+package foo-0.7.1.0 is broken due to missing package
682682+text-1.2.0.4-98506efb1b9ada233bb5c2b2db516d91
683683+```
652684then you have to download and re-install `foo` and all its dependents from
653685scratch:
654654-655655- # nix-store -q --referrers /nix/store/*-haskell-text-1.2.0.4 \
656656- | xargs -L 1 nix-store --repair-path
686686+```shell
687687+nix-store -q --referrers /nix/store/*-haskell-text-1.2.0.4 \
688688+ | xargs -L 1 nix-store --repair-path
689689+```
657690658691If you're using additional Hydra servers other than `hydra.nixos.org`, then it
659692might be necessary to purge the local caches that store data from those
660693machines to disable these binary channels for the duration of the previous
661694command, i.e. by running:
662662-663663- rm /nix/var/nix/binary-cache-v3.sqlite
664664- rm /nix/var/nix/manifests/*
665665- rm /nix/var/nix/channel-cache/*
695695+```shell
696696+rm /nix/var/nix/binary-cache-v3.sqlite
697697+rm /nix/var/nix/manifests/*
698698+rm /nix/var/nix/channel-cache/*
699699+```
666700667701### How to use the Haste Haskell-to-Javascript transpiler
668702669703Open a shell with `haste-compiler` and `haste-cabal-install` (you don't actually need
670704`node`, but it can be useful to test stuff):
671671-672672- $ nix-shell -p "haskellPackages.ghcWithPackages (self: with self; [haste-cabal-install haste-compiler])" -p nodejs
673673-705705+```shell
706706+nix-shell \
707707+ -p "haskellPackages.ghcWithPackages (self: with self; [haste-cabal-install haste-compiler])" \
708708+ -p nodejs
709709+```
674710You may not need the following step but if `haste-boot` fails to compile all the
675711packages it needs, this might do the trick
676676-677677- $ haste-cabal update
678678-712712+```shell
713713+haste-cabal update
714714+```
679715`haste-boot` builds a set of core libraries so that they can be used from Javascript
680716transpiled programs:
681681-682682- $ haste-boot
683683-717717+```shell
718718+haste-boot
719719+```
684720Transpile and run a "Hello world" program:
685685-686686- $ echo 'module Main where main = putStrLn "Hello world"' > hello-world.hs
687687- $ hastec --onexec hello-world.hs
688688- $ node hello-world.js
689689- Hello world
721721+```
722722+$ echo 'module Main where main = putStrLn "Hello world"' > hello-world.hs
723723+$ hastec --onexec hello-world.hs
724724+$ node hello-world.js
725725+Hello world
726726+```
690727691728### Builds on Darwin fail with `math.h` not found
692729693730Users of GHC on Darwin have occasionally reported that builds fail, because the
694731compiler complains about a missing include file:
695695-696696- fatal error: 'math.h' file not found
697697-732732+```
733733+fatal error: 'math.h' file not found
734734+```
698735The issue has been discussed at length in [ticket
6997366390](https://github.com/NixOS/nixpkgs/issues/6390), and so far no good
700737solution has been proposed. As a work-around, users who run into this problem
701738can configure the environment variables
702702-703703- export NIX_CFLAGS_COMPILE="-idirafter /usr/include"
704704- export NIX_CFLAGS_LINK="-L/usr/lib"
705705-739739+```shell
740740+export NIX_CFLAGS_COMPILE="-idirafter /usr/include"
741741+export NIX_CFLAGS_LINK="-L/usr/lib"
742742+```
706743in their `~/.bashrc` file to avoid the compiler error.
707744708745### Builds using Stack complain about missing system libraries
709746710710- -- While building package zlib-0.5.4.2 using:
711711- runhaskell -package=Cabal-1.22.4.0 -clear-package-db [... lots of flags ...]
712712- Process exited with code: ExitFailure 1
713713- Logs have been written to: /home/foo/src/stack-ide/.stack-work/logs/zlib-0.5.4.2.log
747747+```
748748+-- While building package zlib-0.5.4.2 using:
749749+ runhaskell -package=Cabal-1.22.4.0 -clear-package-db [... lots of flags ...]
750750+Process exited with code: ExitFailure 1
751751+Logs have been written to: /home/foo/src/stack-ide/.stack-work/logs/zlib-0.5.4.2.log
714752715715- Configuring zlib-0.5.4.2...
716716- Setup.hs: Missing dependency on a foreign library:
717717- * Missing (or bad) header file: zlib.h
718718- This problem can usually be solved by installing the system package that
719719- provides this library (you may need the "-dev" version). If the library is
720720- already installed but in a non-standard location then you can use the flags
721721- --extra-include-dirs= and --extra-lib-dirs= to specify where it is.
722722- If the header file does exist, it may contain errors that are caught by the C
723723- compiler at the preprocessing stage. In this case you can re-run configure
724724- with the verbosity flag -v3 to see the error messages.
753753+Configuring zlib-0.5.4.2...
754754+Setup.hs: Missing dependency on a foreign library:
755755+* Missing (or bad) header file: zlib.h
756756+This problem can usually be solved by installing the system package that
757757+provides this library (you may need the "-dev" version). If the library is
758758+already installed but in a non-standard location then you can use the flags
759759+--extra-include-dirs= and --extra-lib-dirs= to specify where it is.
760760+If the header file does exist, it may contain errors that are caught by the C
761761+compiler at the preprocessing stage. In this case you can re-run configure
762762+with the verbosity flag -v3 to see the error messages.
763763+```
725764726765When you run the build inside of the nix-shell environment, the system
727727-is configured to find libz.so without any special flags -- the compiler
766766+is configured to find `libz.so` without any special flags -- the compiler
728767and linker "just know" how to find it. Consequently, Cabal won't record
729729-any search paths for libz.so in the package description, which means
768768+any search paths for `libz.so` in the package description, which means
730769that the package works fine inside of nix-shell, but once you leave the
731770shell the shared object can no longer be found. That issue is by no
732771means specific to Stack: you'll have that problem with any other
···735774736775You can remedy this issue in several ways. The easiest is to add a `nix` section
737776to the `stack.yaml` like the following:
777777+```yaml
778778+nix:
779779+ enable: true
780780+ packages: [ zlib ]
781781+```
738782739739- nix:
740740- enable: true
741741- packages: [ zlib ]
742742-743743-Stack's Nix support knows to add `${zlib.out}/lib` and `${zlib.dev}/include` as an
744744-`--extra-lib-dirs` and `extra-include-dirs`, respectively. Alternatively, you
745745-can achieve the same effect by hand. First of all, run
746746-747747- $ nix-build --no-out-link "<nixpkgs>" -A zlib
748748- /nix/store/alsvwzkiw4b7ip38l4nlfjijdvg3fvzn-zlib-1.2.8
749749-783783+Stack's Nix support knows to add `${zlib.out}/lib` and `${zlib.dev}/include`
784784+as an `--extra-lib-dirs` and `extra-include-dirs`, respectively.
785785+Alternatively, you can achieve the same effect by hand. First of all, run
786786+```
787787+$ nix-build --no-out-link "<nixpkgs>" -A zlib
788788+/nix/store/alsvwzkiw4b7ip38l4nlfjijdvg3fvzn-zlib-1.2.8
789789+```
750790to find out the store path of the system's zlib library. Now, you can
751791752752-1) add that path (plus a "/lib" suffix) to your $LD_LIBRARY_PATH
753753- environment variable to make sure your system linker finds libz.so
754754- automatically. It's no pretty solution, but it will work.
792792+ 1. add that path (plus a "/lib" suffix) to your `$LD_LIBRARY_PATH`
793793+ environment variable to make sure your system linker finds `libz.so`
794794+ automatically. It's no pretty solution, but it will work.
755795756756-2) As a variant of (1), you can also install any number of system
757757- libraries into your user's profile (or some other profile) and point
758758- $LD_LIBRARY_PATH to that profile instead, so that you don't have to
759759- list dozens of those store paths all over the place.
760760-761761-3) The solution I prefer is to call stack with an appropriate
762762- --extra-lib-dirs flag like so:
796796+ 2. As a variant of (1), you can also install any number of system
797797+ libraries into your user's profile (or some other profile) and point
798798+ `$LD_LIBRARY_PATH` to that profile instead, so that you don't have to
799799+ list dozens of those store paths all over the place.
763800764764- $ stack --extra-lib-dirs=/nix/store/alsvwzkiw4b7ip38l4nlfjijdvg3fvzn-zlib-1.2.8/lib build
801801+ 3. The solution I prefer is to call stack with an appropriate
802802+ --extra-lib-dirs flag like so:
803803+ ```shell
804804+ stack --extra-lib-dirs=/nix/store/alsvwzkiw4b7ip38l4nlfjijdvg3fvzn-zlib-1.2.8/lib build
805805+ ```
765806766766- Typically, you'll need --extra-include-dirs as well. It's possible
767767- to add those flag to the project's "stack.yaml" or your user's
768768- global "~/.stack/global/stack.yaml" file so that you don't have to
769769- specify them manually every time. But again, you're likely better off using
770770- Stack's Nix support instead.
807807+ Typically, you'll need `--extra-include-dirs` as well. It's possible
808808+ to add those flag to the project's `stack.yaml` or your user's
809809+ global `~/.stack/global/stack.yaml` file so that you don't have to
810810+ specify them manually every time. But again, you're likely better off
811811+ using Stack's Nix support instead.
771812772772- The same thing applies to `cabal configure`, of course, if you're
773773- building with `cabal-install` instead of Stack.
813813+ The same thing applies to `cabal configure`, of course, if you're
814814+ building with `cabal-install` instead of Stack.
774815775816### Creating statically linked binaries
776817777818There are two levels of static linking. The first option is to configure the
778819build with the Cabal flag `--disable-executable-dynamic`. In Nix expressions,
779820this can be achieved by setting the attribute:
780780-781781- enableSharedExecutables = false;
782782-821821+```
822822+enableSharedExecutables = false;
823823+```
783824That gives you a binary with statically linked Haskell libraries and
784825dynamically linked system libraries.
785826786827To link both Haskell libraries and system libraries statically, the additional
787828flags `--ghc-option=-optl=-static --ghc-option=-optl=-pthread` need to be used.
788829In Nix, this is accomplished with:
830830+```
831831+configureFlags = [ "--ghc-option=-optl=-static" "--ghc-option=-optl=-pthread" ];
832832+```
789833790790- configureFlags = [ "--ghc-option=-optl=-static" "--ghc-option=-optl=-pthread" ];
791791-792792-It's important to realize, however, that most system libraries in Nix are built
793793-as shared libraries only, i.e. there is just no static library available that
794794-Cabal could link!
834834+It's important to realize, however, that most system libraries in Nix are
835835+built as shared libraries only, i.e. there is just no static library
836836+available that Cabal could link!
795837796838### Building GHC with integer-simple
797839···801843[integer-gmp](http://hackage.haskell.org/package/integer-gmp) package.
802844803845A potential problem with this is that GMP is licensed under the
804804-[GNU Lesser General Public License (LGPL)](http://www.gnu.org/copyleft/lesser.html),
846846+[GNU Lesser General Public License (LGPL)](http://www.gnu.org/copyleft/lesser.html),
805847a kind of "copyleft" license. According to the terms of the LGPL, paragraph 5,
806848you may distribute a program that is designed to be compiled and dynamically
807849linked with the library under the terms of your choice (i.e., commercially) but
···814856programs compiled with GHC because most distributions (and builds) of GHC use
815857static libraries. (Dynamic libraries are currently distributed only for OS X.)
816858The LGPL licensing situation may be worse: even though
817817-[The Glasgow Haskell Compiler License](https://www.haskell.org/ghc/license)
859859+[The Glasgow Haskell Compiler License](https://www.haskell.org/ghc/license)
818860is essentially a "free software" license (BSD3), according to
819861paragraph 2 of the LGPL, GHC must be distributed under the terms of the LGPL!
820862···825867To get a GHC compiler build with `integer-simple` instead of `integer-gmp` use
826868the attribute: `haskell.compiler.integer-simple."${ghcVersion}"`.
827869For example:
828828-829829- $ nix-build -E '(import <nixpkgs> {}).haskell.compiler.integer-simple.ghc802'
830830- ...
831831- $ result/bin/ghc-pkg list | grep integer
832832- integer-simple-0.1.1.1
833833-870870+```
871871+$ nix-build -E '(import <nixpkgs> {}).haskell.compiler.integer-simple.ghc802'
872872+...
873873+$ result/bin/ghc-pkg list | grep integer
874874+ integer-simple-0.1.1.1
875875+```
834876The following command displays the complete list of GHC compilers build with `integer-simple`:
835835-836836- $ nix-env -f "<nixpkgs>" -qaP -A haskell.compiler.integer-simple
837837- haskell.compiler.integer-simple.ghc7102 ghc-7.10.2
838838- haskell.compiler.integer-simple.ghc7103 ghc-7.10.3
839839- haskell.compiler.integer-simple.ghc722 ghc-7.2.2
840840- haskell.compiler.integer-simple.ghc742 ghc-7.4.2
841841- haskell.compiler.integer-simple.ghc783 ghc-7.8.3
842842- haskell.compiler.integer-simple.ghc784 ghc-7.8.4
843843- haskell.compiler.integer-simple.ghc801 ghc-8.0.1
844844- haskell.compiler.integer-simple.ghc802 ghc-8.0.2
845845- haskell.compiler.integer-simple.ghcHEAD ghc-8.1.20170106
877877+```
878878+$ nix-env -f "<nixpkgs>" -qaP -A haskell.compiler.integer-simple
879879+haskell.compiler.integer-simple.ghc7102 ghc-7.10.2
880880+haskell.compiler.integer-simple.ghc7103 ghc-7.10.3
881881+haskell.compiler.integer-simple.ghc722 ghc-7.2.2
882882+haskell.compiler.integer-simple.ghc742 ghc-7.4.2
883883+haskell.compiler.integer-simple.ghc783 ghc-7.8.3
884884+haskell.compiler.integer-simple.ghc784 ghc-7.8.4
885885+haskell.compiler.integer-simple.ghc801 ghc-8.0.1
886886+haskell.compiler.integer-simple.ghc802 ghc-8.0.2
887887+haskell.compiler.integer-simple.ghcHEAD ghc-8.1.20170106
888888+```
846889847890To get a package set supporting `integer-simple` use the attribute:
848891`haskell.packages.integer-simple."${ghcVersion}"`. For example
849892use the following to get the `scientific` package build with `integer-simple`:
850850-851851- $ nix-build -A haskell.packages.integer-simple.ghc802.scientific
852852-893893+```shell
894894+nix-build -A haskell.packages.integer-simple.ghc802.scientific
895895+```
853896854897## Other resources
855898856856-- The Youtube video [Nix Loves Haskell](https://www.youtube.com/watch?v=BsBhi_r-OeE)
857857- provides an introduction into Haskell NG aimed at beginners. The slides are
858858- available at http://cryp.to/nixos-meetup-3-slides.pdf and also -- in a form
859859- ready for cut & paste -- at
860860- https://github.com/NixOS/cabal2nix/blob/master/doc/nixos-meetup-3-slides.md.
899899+ - The Youtube video [Nix Loves Haskell](https://www.youtube.com/watch?v=BsBhi_r-OeE)
900900+ provides an introduction into Haskell NG aimed at beginners. The slides are
901901+ available at http://cryp.to/nixos-meetup-3-slides.pdf and also -- in a form
902902+ ready for cut & paste -- at
903903+ https://github.com/NixOS/cabal2nix/blob/master/doc/nixos-meetup-3-slides.md.
861904862862-- Another Youtube video is [Escaping Cabal Hell with Nix](https://www.youtube.com/watch?v=mQd3s57n_2Y),
863863- which discusses the subject of Haskell development with Nix but also provides
864864- a basic introduction to Nix as well, i.e. it's suitable for viewers with
865865- almost no prior Nix experience.
905905+ - Another Youtube video is [Escaping Cabal Hell with Nix](https://www.youtube.com/watch?v=mQd3s57n_2Y),
906906+ which discusses the subject of Haskell development with Nix but also provides
907907+ a basic introduction to Nix as well, i.e. it's suitable for viewers with
908908+ almost no prior Nix experience.
866909867867-- Oliver Charles wrote a very nice [Tutorial how to develop Haskell packages with Nix](http://wiki.ocharles.org.uk/Nix).
910910+ - Oliver Charles wrote a very nice [Tutorial how to develop Haskell packages with Nix](http://wiki.ocharles.org.uk/Nix).
868911869869-- The *Journey into the Haskell NG infrastructure* series of postings
870870- describe the new Haskell infrastructure in great detail:
912912+ - The *Journey into the Haskell NG infrastructure* series of postings
913913+ describe the new Haskell infrastructure in great detail:
871914872872- - [Part 1](http://lists.science.uu.nl/pipermail/nix-dev/2015-January/015591.html)
873873- explains the differences between the old and the new code and gives
874874- instructions how to migrate to the new setup.
915915+ - [Part 1](http://lists.science.uu.nl/pipermail/nix-dev/2015-January/015591.html)
916916+ explains the differences between the old and the new code and gives
917917+ instructions how to migrate to the new setup.
875918876876- - [Part 2](http://lists.science.uu.nl/pipermail/nix-dev/2015-January/015608.html)
877877- looks in-depth at how to tweak and configure your setup by means of
878878- overrides.
919919+ - [Part 2](http://lists.science.uu.nl/pipermail/nix-dev/2015-January/015608.html)
920920+ looks in-depth at how to tweak and configure your setup by means of
921921+ overrides.
879922880880- - [Part 3](http://lists.science.uu.nl/pipermail/nix-dev/2015-April/016912.html)
881881- describes the infrastructure that keeps the Haskell package set in Nixpkgs
882882- up-to-date.
923923+ - [Part 3](http://lists.science.uu.nl/pipermail/nix-dev/2015-April/016912.html)
924924+ describes the infrastructure that keeps the Haskell package set in Nixpkgs
925925+ up-to-date.