git.iko.soy/typeable/cabal2nix
on master help sign in
doc: user-guide.md is complete'ish
commit648d9bd020580ed1bb94379a2d072a4bc475e225 authorPeter Simons <simons@cryp.to> dateWed 20 May 2015, 16:40 (11 years ago) parentd692bb2
1 file changed+61−10
doc/user-guide.md+61−10
doc/user-guide.md+61−10
@@ -1,16 +1,19 @@
11% Nix loves Haskell
22% Peter Simons \<simons@cryp.to\>
3−% 2015-05-15
3+% 2015-05-21
44
55-------------------------------------------------------------------------------
66
7−# What can Nix do for you?
7+# Road-map of this presentation
88
9−1) Install any Haskell package known to Hackage.
10−
11−2) Install a Haskell compiler.
12−
13−3) Create a Haskell development environment.
9+- Install Haskell packages from Hackage
10+- Install one (or many) Haskell compiler(s)
11+- Create a Haskell development environment
12+ - permanent environments with `ghcWithPackages`
13+ - ad-hoc environments for `nix-shell`
14+- Integrate your own (non-public) packages into Nix
15+- Take advantage of the central build farm
16+- Pitfalls to avoid
1417
1518-------------------------------------------------------------------------------
1619
@@ -203,9 +206,7 @@ To parameterize the compiler version, edit the file as follows:
203206 ghc = haskell.packages.${compiler}.ghcWithPackages
204207 (pkgs: with pkgs; [ aeson lens monad-par ]);
205208 in
206− stdenv.mkDerivation {
207− [...]
208− }
209+ [...]
209210
210211Now run "`nix-shell --argstr compiler ghc784`" to select a different
211212compiler.
@@ -297,8 +298,58 @@ Use this `~/.nixpkgs/config.nix` file to register the build inside of
297298
298299-------------------------------------------------------------------------------
299300
301+# How to download binary packages
302+
303+NixOS users add this setting to `/etc/nixos/configuration.nix`:
304+
305+ nix.trustedBinaryCaches = [
306+ http://hydra.cryp.to
307+ http://hydra.nixos.org
308+ ];
309+
310+Everyone else adds this setting to `/etc/nix/nix.conf`:
311+
312+ trusted-binary-caches = http://hydra.nixos.org \
313+ http://hydra.cryp.to
314+
315+Now run `nix-env`, `nix-build`, and `nix-shell` with this option:
316+
317+ --option extra-binary-caches http://hydra.nixos.org
318+
319+-------------------------------------------------------------------------------
320+
321+# GHC's infamous non-deterministic library ID bug
322+
323+GHC and distributed build farms don't get along well:
324+
325+ https://ghc.haskell.org/trac/ghc/ticket/4012
326+ https://github.com/NixOS/nixpkgs/issues/7792
327+
328+When you see an error like this one
329+
330+ package foo-0.7.1.0 is broken due to missing package
331+ text-1.2.0.4-98506efb1b9ada233bb5c2b2db516d91
332+
333+then you have to garbage collect `foo` and all its dependents,
334+and re-install from scratch.
335+
336+-------------------------------------------------------------------------------
337+
300338# Where to get help ...
301339
340+Haskell-specific resources:
341+
342+- https://github.com/NixOS/nixpkgs/issues/4941
343+
344+- A Journey into the Haskell NG infrastructure
345+ - Part 1: http://lists.science.uu.nl/pipermail/nix-dev/2015-January/015591.html
346+ - Part 2: http://lists.science.uu.nl/pipermail/nix-dev/2015-January/015608.html
347+ - Part 3: http://lists.science.uu.nl/pipermail/nix-dev/2015-April/016912.html
348+
349+- Oliver Charles Wiki: http://wiki.ocharles.org.uk/Nix
350+
351+General Nix resources:
352+
302353- `https://nixos.org/`
303354
304355- `nix-dev@lists.science.uu.nl`