on iko/ghcjs-patch-master help sign in
Reorganize tutorials (#702)

* fix hackage and stackage to work * user-guides -> tutorials * Restructure tutorials * getting-started: clarify on packages and components * Update docs/tutorials/development.md Co-authored-by: Rodney Lorrimar <dev@rodney.id.au> * getting-started: bail out if cabal.project and stack.yaml are present * hackage-stackage: delete duplicated content Co-authored-by: Rodney Lorrimar <dev@rodney.id.au>

commit2852a9521f030e4b89672d899355ac1340137ac4 authorDomen Kožar <domen@dev.si> dateFri 19 Jun 2020, 03:37 (6 years ago) parentd7b6258
20 files changed+451−664
README.md+3−91 docs/index.md+6−6 docs/reference/commands.md+2−2 docs/reference/library.md+4−4 docs/tutorials/building-package-from-stackage-hackage.md+38 docs/user-guide/clean-git.md → docs/tutorials/clean-git.md docs/user-guide/cross-compilation.md → docs/tutorials/cross-compilation.md docs/user-guide/development.md → docs/tutorials/development.md+36−1 docs/tutorials/getting-started.md+145 docs/user-guide/hackage-stackage.md → docs/tutorials/hackage-stackage.md+3−3 docs/tutorials/installing-nix-tools.md+26 docs/tutorials/manually-generating-nix-expressions.md+179 docs/user-guide/materialization.md → docs/tutorials/materialization.md docs/dev/pkg-map.md → docs/tutorials/pkg-map.md docs/user-guide/source-repository-hashes.md → docs/tutorials/source-repository-hashes.md docs/user-guide.md−310 docs/user-guide/cabal-projects.md−96 docs/user-guide/projects.md−84 docs/user-guide/stack-projects.md−58 mkdocs.yml+9−9
README.md+3−91
@@ -6,98 +6,10 @@
66`haskell.nix` can automatically translate your Cabal or Stack project and
77its dependencies into Nix code.
88
9−## [Documentation](https://input-output-hk.github.io/haskell.nix/)
9+## Documentation
1010
11−## Getting started
12−
13−### a) Using `cabal.project`
14−
15−Add a `default.nix`:
16−
17−```nix
18−let
19− # Fetch the latest haskell.nix and import its default.nix
20− haskellNix = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz) {};
21−
22− # haskell.nix provides access to the nixpkgs pins which are used by our CI, hence
23− # you will be more likely to get cache hits when using these.
24− # But you can also just use your own, e.g. '<nixpkgs>'
25− nixpkgsSrc = haskellNix.sources.nixpkgs-2003;
26−
27− # haskell.nix provides some arguments to be passed to nixpkgs, including some patches
28− # and also the haskell.nix functionality itself as an overlay.
29− nixpkgsArgs = haskellNix.nixpkgsArgs;
30−in
31−{ pkgs ? import nixpkgsSrc nixpkgsArgs
32−, haskellCompiler ? "ghc865"
33−}:
34−
35−# 'cabalProject' generates a package set based on a cabal.project (and the corresponding .cabal files)
36−pkgs.haskell-nix.cabalProject {
37− # 'cleanGit' cleans a source directory based on the files known by git
38− src = pkgs.haskell-nix.haskellLib.cleanGit { name = "haskell-nix-project"; src = ./.; };
39− compiler-nix-name = haskellCompiler;
40−}
41−```
42−
43−Note that you'll need to add a comment specifying the expected sha256
44−output for your `source-repository-packages` in your `cabal.project`
45−file:
46−
47−```
48−source-repository-package
49− type: git
50− location: https://github.com/input-output-hk/iohk-monitoring-framework
51− subdir: plugins/backend-editor
52− tag: 4956b32f039579a0e7e4fd10793f65b4c77d9044
53− --sha256: 03lyb2m4i6p7rpjqarnhsx21nx48fwk6rzsrx15k6274a4bv0pix
54−```
55−
56−### b) Using `stack.yaml`
57−
58−Add a `default.nix`:
59−
60−```nix
61−let
62− haskellNix = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz) {};
63− nixpkgsSrc = haskellNix.sources.nixpkgs-2003;
64− nixpkgsArgs = haskellNix.nixpkgsArgs;
65−in
66−{ pkgs ? import nixpkgsSrc nixpkgsArgs
67−}:
68−pkgs.haskell-nix.stackProject {
69− src = pkgs.haskell-nix.haskellLib.cleanGit { name = "haskell-nix-project"; src = ./.; };
70−}
71−```
72−
73−### Working with a project
74−
75−To build the library component of a package in the project run:
76−
77−```shell
78−nix build -f . your-package-name.components.library
79−```
80−
81−To build an executable:
82−
83−```shell
84−nix build -f . your-package-name.components.exes.your-exe-name
85−```
86−
87−To open a shell for use with `cabal` run:
88−
89−```shell
90−nix-shell -A shellFor
91−cabal new-build your-package-name
92−cabal new-repl your-package-name:library:your-package-name
93−```
94−
95−## Using a binary cache
96−
97−To use precompiled binaries you'll need:
98−
99−- To configure the IOHK binary cache by following the instructions on [iohk.cachix.org](https://iohk.cachix.org).
100−- To pin your `nixpkgs` to match one of the revisions built by our CI: these can be found inside the `sources` attribute (see the quickstart above for an example).
11+- [Introduction](https://input-output-hk.github.io/haskell.nix/)
12+- [Getting Started](https://input-output-hk.github.io/haskell.nix/getting-started/)
10113
10214## Related repos
10315
docs/index.md+6−6
@@ -4,12 +4,12 @@
44
55## Features
66
7−- autogenerate Nix expressions for Cabal project
8−- autogenerate Nix expressions for Stack
9−- overridable configuration
10−- cross-compilation
7+- Drop-in support for Cabal projects
8+- Drop-in support for Stack projects
9+- Build any package of specific version in Stackage or Hackage
10+- Overridable configuration
11+- Cross compile Haskell packages
1112
12−[^1]: See [Nixpkgs current Users' Guide to Haskell Infrastructure][nixpkgs] for comparison.
13−[nixpkgs]: https://nixos.org/nixpkgs/manual/#users-guide-to-the-haskell-infrastructure
13+[^1]: See [Nixpkgs current Users' Guide to Haskell Infrastructure](https://nixos.org/nixpkgs/manual/#users-guide-to-the-haskell-infrastructure) for comparison.
1414
1515
docs/reference/commands.md+2−2
@@ -19,7 +19,7 @@ Available options:
1919
2020Use this for stack projects. If a `default.nix` does not exist in the
2121output directory, it will create a basic one with a
22−[`mkStackPkgSet`](../user-guide/stack-projects.md) function.
22+[`mkStackPkgSet`](../manually-generating-nix-expressions#Using-Stack) function.
2323
2424!!! note
2525 If you find that there are missing files which should have been
@@ -49,7 +49,7 @@ Available options:
4949
5050Use this for Cabal new-build projects (even if you don't have a
5151`cabal.project`). Before running, you need to create a plan. For more
52−information, see [Cabal Projects](../user-guide/cabal-projects.md) in the user
52+information, see [Cabal Projects](../manually-generating-nix-expressions#Using-Cabal) in the user
5353guide.
5454
5555It will create a template `default.nix` in the output directory,
docs/reference/library.md+4−4
@@ -1,7 +1,7 @@
11[Haskell.nix][] contains a library of functions for creating buildable
22package sets from their Nix expression descriptions. The library is
33what you get when importing [Haskell.nix][]. It might be helpful to
4−load the library in the [Nix REPL](../user-guide.md#using-nix-repl) to
4+load the library in the [Nix REPL](../tutorials/development.md#using-nix-repl) to
55test things.
66
77 * [Types](#types) — the kinds of data that you will encounter working with [Haskell.nix][].
@@ -98,7 +98,7 @@ attrset of package descriptions.
9898Modules are the primary method of configuring building of the package
9999set. They are either:
100100
101−1. an attrset containing [option declarations](./options.md), or
101+1. an attrset containing [option declarations](./modules.md), or
1021022. a function that returns an attrset containing option declarations.
103103
104104If using the function form of a module, the following named parameters
@@ -354,7 +354,7 @@ These functions exist within the `hsPkgs` package set.
354354## shellFor
355355
356356Create a `nix-shell` [development
357−environment](../user-guide/development.md) for developing one or more
357+environment](../tutorials/development.md) for developing one or more
358358packages with `ghci` or `cabal v2-build` (but not Stack).
359359
360360```
@@ -386,7 +386,7 @@ shellFor =
386386## ghcWithPackages
387387
388388Creates a `nix-shell` [development
389−environment](../user-guide/development.md) including the given
389+environment](../tutorials/development.md) including the given
390390packages selected from this package set.
391391
392392**Parameter**: a package selection function.
docs/tutorials/building-package-from-stackage-hackage.mdnew file+38
@@ -0,0 +1,38 @@
1+
2+# Build a specific package from hackage or a [stackage][] lts or nightly set.
3+
4+To build a package, say [lens][], from a stackage snapshot, say [lts-13.28][],
5+you could run
6+```bash
7+nix build '(with import <nixpkgs> (import ./. {}).nixpkgsArgs; haskell-nix.snapshots."lts-13.28").lens.components.library'
8+```
9+which would build the [lens][] library component from the lens package as fixed
10+by the [lts-13.28][] stackage snapshot.
11+
12+## Specific version
13+
14+To build any package from hackage, say [lens][], in version, say 4.17.1, you
15+could run
16+```bash
17+nix build '(with import <nixpkgs> (import ./. {}).nixpkgsArgs; (haskell-nix.hackage-package { name = "lens"; version = "4.17.1"; })).components.library'
18+```
19+which would build the [lens][] library component from the [lens-4.17.1][] package
20+from hackage.
21+
22+## Pinning hackage index
23+
24+The dependencies would be solved against the most recent
25+[hackage-index-state][] that comes via the [hackage.nix][] pin with your
26+[haskell.nix][] checkout. A specific one can be specified as well:
27+```bash
28+nix build '(with import <nixpkgs> (import ./. {}).nixpkgsArgs; (haskell-nix.hackage-package { name = "lens"; version = "4.17.1"; index-state = "2019-07-14T00:00:00Z"; })).components.library'
29+```
30+which would use the hackage index as of `2019-07-14T00:00:00Z` to produce a build plan
31+for the [lens-4.17.1][] package.
32+
33+[stackage]: https://stackage.org
34+[hackage.nix]: https://github.com/input-output-hk/hackage.nix
35+[lts-13.28]: https://www.stackage.org/lts-13.28
36+[lens]: https://hackage.haskell.org/package/lens
37+[lens-4.17.1]: https://hackage.haskell.org/package/lens-4.17.1
38+[hackage-index-state]: https://github.com/input-output-hk/hackage.nix/blob/master/index-state-hashes.nix
docs/user-guide/clean-git.md → docs/tutorials/clean-git.mdrenamed

The content is the same.

docs/user-guide/cross-compilation.md → docs/tutorials/cross-compilation.mdrenamed

The content is the same.

docs/user-guide/development.md → docs/tutorials/development.mdrenamed+36−1
@@ -11,7 +11,7 @@ Every dependency will be cached in your Nix store. If you have set up
1111Hydra CI, then your team can share pre-built dependencies.
1212
1313These examples assume that you have created your package set as
14−described in [Creating Nix builds for your projects](projects.md) and
14+described in [Creating Nix builds for your projects](getting-started.md) and
1515it exists in a file called `default.nix`.
1616
1717!!! note
@@ -179,3 +179,38 @@ Emacs to use it. The way I do it is:
1791794. For [`haskell‑mode`](https://github.com/haskell/haskell-mode)
180180 interactive Haskell, set `haskell‑process‑type` to
181181 `cabal‑new‑repl`.
182+
183+## Using `nix repl`
184+
185+It's sometimes useful to load [Haskell.nix][] in the REPL to explore
186+attrsets and try examples.
187+
188+```
189+# example.nix
190+{ nixpkgs ? <nixpkgs> }:
191+rec {
192+ haskell = import nixpkgs (import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz) {}).nixpkgsArgs;
193+ pkgNames = haskell.pkgs.lib.attrNames haskell.haskell-nix.snapshots."lts-13.18";
194+}
195+```
196+
197+Load the example file:
198+
199+```
200+$ nix repl '<nixpkgs>' example.nix
201+Welcome to Nix version 2.3pre6631_e58a7144. Type :? for help.
202+
203+Loading '<nixpkgs>'...
204+Added 10403 variables.
205+
206+Loading 'example.nix'...
207+Added 2 variables.
208+
209+nix-repl> lib.take 5 pkgNames
210+[ "ALUT" "ANum" "Allure" "Boolean" "BoundedChan" ]
211+
212+nix-repl>
213+```
214+
215+Now that you have `nix-tools` and are able to import [Haskell.nix][],
216+you can continue to the next chapter.
docs/tutorials/getting-started.mdnew file+145
@@ -0,0 +1,145 @@
1+# Getting started
2+
3+`haskell.nix` can automatically translate your Cabal or Stack project and its dependencies into Nix code.
4+
5+This tutorial will teach you how to setup your project
6+
7+Assuming you have [Nix installed](https://nixos.org/download.html), you can start setting up your project.
8+
9+## Setting up the Cachix binary cache
10+
11+You can **avoid compiling GHC and nix-tools** by configuring [Cachix](https://cachix.org)
12+so you can benefit from the binary cache built by CI:
13+
14+```bash
15+$ nix-env -iA cachix -f https://cachix.org/api/v1/install
16+$ cachix use iohk
17+```
18+
19+## Scaffolding
20+
21+The following configuration will use `stack.yaml` if it exists,
22+otherwise fallback to `cabal.project`.
23+
24+Add `default.nix`:
25+
26+```nix
27+{ haskellCompiler ? "ghc865"
28+
29+# Fetch the latest haskell.nix and import its default.nix
30+, haskellNix ? import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz) {}
31+
32+# haskell.nix provides access to the nixpkgs pins which are used by our CI, hence
33+# you will be more likely to get cache hits when using these.
34+# But you can also just use your own, e.g. '<nixpkgs>'
35+, nixpkgsSrc ? haskellNix.sources.nixpkgs-2003
36+
37+# haskell.nix provides some arguments to be passed to nixpkgs, including some patches
38+# and also the haskell.nix functionality itself as an overlay.
39+, nixpkgsArgs ? haskellNix.nixpkgsArgs
40+
41+# import nixpkgs with overlays
42+, pkgs ? import nixpkgsSrc nixpkgsArgs
43+
44+# 'cleanGit' cleans a source directory based on the files known by git
45+, src ? pkgs.haskell-nix.haskellLib.cleanGit {
46+ name = "haskell-nix-project";
47+ src = ./.;
48+ }
49+, hasStack ? builtins.pathExists (./. + "/cabal.project")
50+, hasCabalProject ? builtins.pathExists (./. + "/stack.yaml")
51+}:
52+
53+assert (if hasStack && hasCabalProject then throw "This project has both stack.yaml and cabal.project. Edit default.nix to pick the one you'd like to use." else true);
54+
55+if hasStack
56+then pkgs.haskell-nix.stackProject
57+ { inherit src;
58+ }
59+else pkgs.haskell-nix.cabalProject
60+ { inherit src;
61+ compiler-nix-name = haskellCompiler;
62+ }
63+```
64+
65+!!! note "git dependencies"
66+ If you have git dependencies in your project, you'll need
67+ to [calculate sha256 hashes for them](./source-repository-hashes.md).
68+
69+### Working with a project
70+
71+Top-level attributes are Haskell packages (incl. dependencies) part of your project.
72+
73+To build the library component of a package in the project run:
74+
75+```shell
76+nix-build -A your-package-name.components.library
77+```
78+
79+There are also other components such as `exes`, `tests`, `benchmarks` and `all`.
80+To build an executable:
81+
82+```shell
83+nix-build -A your-package-name.components.exes.your-exe-name
84+```
85+
86+To open a shell for use with `cabal` run:
87+
88+```shell
89+nix-shell -A shellFor
90+cabal new-repl your-package-name:library:your-package-name
91+cabal new-build your-package-name
92+```
93+
94+To open a shell for use with `stack` see [the following issue](https://github.com/input-output-hk/haskell.nix/issues/689#issuecomment-643832619).
95+
96+### Pinning the [Haskell.nix][] version
97+
98+For simplicity's sake we will use `fetchTarball` for the examples in
99+this documentation. This will always get the latest version, and is
100+similar to an auto-updating Nix channel.
101+
102+However, in your own project, you may wish to pin [Haskell.nix][] (as
103+you would pin Nixpkgs). This will make your builds reproducible, more
104+predictable, and faster (because the fixed version is cached).
105+
106+One way of doing this is to use `nix-prefetch-git` to get a JSON file
107+with a revision and SHA-256 hash of [Haskell.nix][].
108+
109+```
110+$ nix-prefetch-git --quiet https://github.com/input-output-hk/haskell.nix | tee haskell-nix-src.json
111+{
112+ "url": "https://github.com/input-output-hk/haskell.nix",
113+ "rev": "f1a94a4c82a2ab999a67c3b84269da78d89f0075",
114+ "date": "2019-06-05T01:06:12+00:00",
115+ "sha256": "0ggxsppjlb6q6a83y12cwgrdnqnw1s128rpibgzs5p1966bdfqla",
116+ "fetchSubmodules": false
117+}
118+```
119+
120+(The `tee` command is just to show you the result.)
121+Use the following expression to import that version:
122+
123+```nix
124+{ nixpkgs ? <nixpkgs> }:
125+
126+let
127+ spec = builtins.fromJSON (builtins.readFile ./haskell-nix-src.json);
128+ haskell-nix-src = (import nixpkgs {}).fetchgit {
129+ name = "haskell-lib";
130+ inherit (spec) url rev sha256 fetchSubmodules;
131+ };
132+in
133+ import nixpkgs (import haskell-nix-src)
134+```
135+
136+There are other possible schemes for pinning. See
137+[`haskell.nix/lib/fetch-external.nix`](https://github.com/input-output-hk/haskell.nix/blob/master/lib/fetch-external.nix),
138+the [niv](https://github.com/nmattia/niv) tool, or the Nix Flakes
139+proposal.
140+
141+# Going forward
142+
143+There are a number of things to explore further in the tutorials section.
144+
145+[haskell.nix]: https://github.com/input-output-hk/haskell.nix
docs/user-guide/hackage-stackage.md → docs/tutorials/hackage-stackage.mdrenamed+3−3
@@ -1,4 +1,4 @@
1−# Hackage and Stackage
1+# Bumping Hackage and Stackage snapshots
22
33`haskell.nix` relies on some generated data providing information about packages in Hackage and Stackage snapshots.
44These are kept in [`hackage.nix`](https://github.com/input-output-hk/hackage.nix) and [`stackage.nix`](https://github.com/input-output-hk/stackage.nix) respectively.
@@ -12,7 +12,7 @@ These revisions are updated nightly, so you can get newer revisions of `hackage.
1212However, this exposes you to changes in `haskell.nix` which you may not want, such as changes that force compiler rebuilds, or the occasional bug.
1313Instead, you can pin `hackage.nix` and `stackage.nix` independently. For example:
1414
15−```
15+```nix
1616let
1717 # You can use a tool like `niv` to manage this boilerplate
1818 hackageSrc = builtins.fetchTarball https://github.com/input-output-hk/hackage.nix/archive/master.tar.gz;
@@ -29,6 +29,6 @@ let
2929in ...
3030```
3131
32−You can then change the revisions that `hackage.nix` and `stackage.nix` are fetched from without changing `haskell.nix`.
32+This way you can change the revisions of `hackage.nix` and `stackage.nix` are fetched from without changing `haskell.nix`.
3333
3434However, bear in mind that Stackage refers to Hackage, so your Stackage should never be newer than Hackage.
docs/tutorials/installing-nix-tools.mdnew file+26
@@ -0,0 +1,26 @@
1+## Installing `nix-tools`
2+
3+To build the latest `nix-tools` and store the result at `./nt`, run:
4+
5+```bash
6+nix build -f https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz pkgs.haskell-nix.nix-tools --out-link nt
7+```
8+
9+If you would like to then install `nix-tools` into your profile, run:
10+
11+```bash
12+nix-env -i ./nt
13+```
14+
15+## Optional: Installing via [Haskell.nix][] source
16+
17+The [Haskell.nix][] and `nix-tools` source will be useful if you would
18+like to contribute improvements, or read the source code to fully
19+understand something that the documentation doesn't cover.
20+
21+```bash
22+git clone https://github.com/input-output-hk/nix-tools
23+git clone https://github.com/input-output-hk/haskell.nix
24+cd haskell.nix
25+nix build -f . pkgs.haskell-nix.nix-tools --arg sourcesOverride '{ nix-tools = ../nix-tools; }' --out-link nt
26+```
docs/tutorials/manually-generating-nix-expressions.mdnew file+179
@@ -0,0 +1,179 @@
1+# Manually generating Nix expressions
2+
3+We believe that imports from derivations (IFDs) provide tremendous
4+value in nix and the aversion towards them stems mostly from
5+poor tooling and ci support for them. We do not believe
6+that poor tooling or ci support should cripple nix capability
7+of abstraction. Hence haskell.nix makes excessive use of
8+IFDs.
9+
10+We do note however that there are users who prefer to
11+have IFD-free expressions. For this group of users we
12+detail how to expand the IFD dependent high level functions
13+into their IFD free building blocks.
14+
15+The general structure will be the same, independent of the use of
16+Stack or Cabal.
17+
18+Let us assume for now that we have already generated a `pkgs.nix`
19+expression (see the links bellow). The following file then produces a package set:
20+
21+```nix
22+# default.nix
23+let
24+ # Import the Haskell.nix library,
25+ pkgs = import <nixpkgs> (import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz) {}).nixpkgsArgs;
26+
27+ # Import the file you will create in the stack-to-nix or cabal-to-nix step.
28+ my-pkgs = import ./pkgs.nix;
29+
30+ # Stack projects use this:
31+ pkgSet = pkgs.haskell-nix.mkStackPkgSet {
32+ stack-pkgs = my-pkgs;
33+ pkg-def-extras = [
34+ # these extras will provide additional packages
35+ # ontop of the package set. E.g. extra-deps
36+ # for stack packages. or local packages for
37+ # cabal.projects
38+ ];
39+ modules = [
40+ # specific package overrides would go here
41+ # example:
42+ # packages.cbors.package.ghcOptions = "-Werror";
43+ # packages.cbors.patches = [ ./one.patch ];
44+ # packages.cbors.flags.optimize-gmp = false;
45+ # It may be better to set flags in stack.yaml instead
46+ # (`stack-to-nix` will include them as defaults).
47+ ];
48+ };
49+
50+ # Cabal projects use this:
51+ pkgSet = pkgs.haskell-nix.mkCabalProjectPkgSet {
52+ plan-pkgs = my-pkgs;
53+ pkg-def-extras = [];
54+ modules = [
55+ # specific package overrides would go here
56+ # example:
57+ # packages.cbors.package.ghcOptions = "-Werror";
58+ # packages.cbors.patches = [ ./one.patch ];
59+ # packages.cbors.flags.optimize-gmp = false;
60+ # It may be better to set flags in `cabal.project` instead
61+ # (`plan-to-nix` will include them as defaults).
62+ ];
63+ };
64+
65+in pkgSet.config.hsPkgs // { _config = pkgSet.config; }
66+```
67+
68+With this setup you can then start building the components of
69+interest:
70+
71+```bash
72+nix build -f default.nix $pkg.components.library
73+```
74+
75+to build the library for `$pkg` or
76+
77+```bash
78+nix build -f default.nix $pkg.components.exes.$exe
79+```
80+
81+to build a specific executable. The same holds for test suites and benchmarks.
82+
83+## Using Stack
84+
85+With [nix-tools installed](./installing-nix-tools.md), we can simply run the
86+following command on a stack project:
87+
88+```bash
89+stack-to-nix --output . --stack-yaml stack.yaml
90+```
91+
92+This will produce a `pkgs.nix` file that looks like the following:
93+```nix
94+{
95+ resolver = "lts-12.17";
96+ extras = hackage:
97+ {
98+ packages = {
99+ "o-clock" = hackage.o-clock."0.1.1".revisions.default;
100+ ...
101+ } // {
102+ my-package = ./my-package.nix;
103+ ...
104+ };
105+ };
106+}
107+```
108+
109+This file contains the stackage resolver, as well as set of extra
110+packages. The extras specifies which `extra-deps` (here:
111+`o-clock-0.1.1`) we wanted to add over the stackage snapshot, and what
112+local packages we want (here: `my-package`).
113+
114+## Using Cabal
115+
116+### Generating `plan.json`
117+
118+To get a plan, you need Cabal and GHC. See the [How to install a
119+compiler section of the Nixpkgs Manual][compiler] for information
120+about how to choose a specific compiler version.
121+
122+[compiler]: https://nixos.org/nixpkgs/manual/#how-to-install-a-compiler
123+
124+!!! note "Cabal version"
125+ The minimum Cabal version is 2.4. This version is available
126+ in the NixOS 19.03 release.
127+
128+For this example, we will run a `nix-shell` with the default GHC
129+version for Nixpkgs.
130+
131+```bash
132+nix-shell -p haskellPackages.cabal-install haskellPackages.ghc \
133+ --run "cabal new-configure"
134+```
135+
136+If all goes well, you should now have the file
137+`dist-newstyle/cache/plan.json`.
138+
139+!!! tip "Specifying the GHC version"
140+ To use a specific compiler version, replace `haskellPackages.ghc`
141+ with something like `haskell-nix.compiler.ghc865`. The given compiler
142+ must exist in your Nixpkgs version, of course. See also the
143+ [Nixpkgs Manual][compiler].
144+
145+### Using `plan-to-nix`
146+
147+With [nix-tools installed](./installing-nix-tools.md), we can then run the
148+following command on a Cabal project and its build plan. Omit the
149+`--cabal-project` option if you don't have a project file.
150+
151+```bash
152+# convert the plan.json file into a pkgs.nix file
153+plan-to-nix --output . \
154+ --plan-json dist-newstyle/cache/plan.json
155+ --cabal-project cabal.project
156+```
157+
158+This will produce a `pkgs.nix` file that looks like the following:
159+
160+```nix
161+{
162+ pkgs = hackage:
163+ {
164+ packages = {
165+ "o-clock" = hackage.o-clock."0.1.1".revisions.default;
166+ ...
167+ };
168+ compiler = { ... };
169+ };
170+
171+ extras = hackage:
172+ { packages = { my-package = ./.plan.nix/my-package.nix; }; };
173+}
174+```
175+
176+It has converted Cabal's build plan into a Nix expression that selects
177+dependencies from `hackage.nix`. All local packages in the project are
178+generated with `cabal-to-nix` and added to the package set
179+description.
docs/user-guide/materialization.md → docs/tutorials/materialization.mdrenamed

The content is the same.

docs/dev/pkg-map.md → docs/tutorials/pkg-map.mdrenamed

The content is the same.

docs/user-guide/source-repository-hashes.md → docs/tutorials/source-repository-hashes.mdrenamed

The content is the same.

docs/user-guide.mddeleted−310
@@ -1,310 +0,0 @@
1−# User Guide
2−
3−[Haskell.nix][] can be use for two different use cases:
4−
5−### Use 1 : to build a specific package from hackage or a [stackage][] lts or nightly set.
6−
7−To build a package, say [lens][], from a stackage snapshot, say [lts-13.28][],
8−you could run
9−```bash
10−nix build '(with import <nixpkgs> (import ./. {}).nixpkgsArgs; haskell-nix.snapshots."lts-13.28").lens.components.library'
11−```
12−which would build the [lens][] library component from the lens package as fixed
13−by the [lts-13.28][] stackage snapshot.
14−
15−To build any package from hackage, say [lens][], in version, say 4.17.1, you
16−could run
17−```bash
18−nix build '(with import <nixpkgs> (import ./. {}).nixpkgsArgs; (haskell-nix.hackage-package { name = "lens"; version = "4.17.1"; })).components.library'
19−```
20−which would build the [lens][] library component from the [lens-4.17.1][] package
21−from hackage. The dependencies would be solved against the most recent
22−[hackage-index-state][] that comes via the [hackage.nix][] pin with your
23−[haskell.nix][] checkout. A specific one can be specified as well:
24−```bash
25−nix build '(with import <nixpkgs> (import ./. {}).nixpkgsArgs; (haskell-nix.hackage-package { name = "lens"; version = "4.17.1"; index-state = "2019-07-14T00:00:00Z"; })).components.library'
26−```
27−which would use the hackage index as of `2019-07-14T00:00:00Z` to produce a build plan
28−for the [lens-4.17.1][] package.
29−
30−
31−### Use 2 : to build a stack or cabal project.
32−
33−So you want to use [Haskell.nix][] with your stack or cabal project. The
34−general approach will be to pick the right tool from `nix-tools` and
35−produce a `pkgs.nix` expression. Getting a copy of the `nix-tools`
36−(and potentially the [Haskell.nix][] source), will then equip us to
37−produce derivations that we can `nix build`.
38−
39−[haskell.nix]: https://github.com/input-output-hk/haskell.nix
40−[stackage]: https://stackage.org
41−[lts-13.28]: https://www.stackage.org/lts-13.28
42−[lens]: https://hackage.haskell.org/package/lens
43−[lens-4.17.1]: https://hackage.haskell.org/package/lens-4.17.1
44−[hackage.nix]: https://github.com/input-output-hk/hackage.nix
45−[hackage-index-state]: https://github.com/input-output-hk/hackage.nix/blob/master/index-state-hashes.nix
46−
47−## Installing `nix-tools`
48−
49−To build the latest `nix-tools` and store the result at `./nt`, run:
50−
51−```bash
52−nix build -f https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz pkgs.haskell-nix.nix-tools --out-link nt
53−```
54−
55−If you would like to then install `nix-tools` into your profile, run:
56−
57−```bash
58−nix-env -i ./nt
59−```
60−
61−## Getting the [Haskell.nix][] source (optional)
62−
63−The [Haskell.nix][] and `nix-tools` source will be useful if you would
64−like to contribute improvements, or read the source code to fully
65−understand something that the documentation doesn't cover.
66−
67−```bash
68−git clone https://github.com/input-output-hk/nix-tools
69−git clone https://github.com/input-output-hk/haskell.nix
70−cd haskell.nix
71−nix build -f . pkgs.haskell-nix.nix-tools --arg sourcesOverride '{ nix-tools = ../nix-tools; }' --out-link nt
72−```
73−
74−## Setting up the Cachix binary cache
75−
76−CI pushes to [cachix](https://cachix.org) so you can benefit from the cache if
77−you pin a combination of `haskell.nix` and `nixpkgs` built by CI. You'll need
78−to configure the [iohk cachix](https://iohk.cachix.org) as a
79−`substituter` for `nix` and add the public key found at the url to
80−`trusted-public-keys`.
81−
82−## Using [Haskell.nix][] with your project
83−
84−The easiest way to get a hold of [Haskell.nix][] is with
85−[`fetchTarball`](https://nixos.org/nix/manual/#ssec-builtins).
86−
87−```nix
88−import <nixpkgs> (import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz) {}).nixpkgsArgs
89−```
90−
91−### Using your cabal.project file
92−
93−If your project has a `cabal.project` you can add a `default.nix` like this:
94−
95−```nix
96−{ pkgs ? import <nixpkgs> (import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz) {}).nixpkgsArgs
97−, compiler-nix-name ? "ghc865"
98−}:
99− pkgs.haskell-nix.cabalProject {
100− src = pkgs.haskell-nix.haskellLib.cleanGit { src = ./.; };
101− inherit compiler-nix-name;
102− # pkg-def-extras = [
103− # # Additional packages ontop of all those listed in `cabal.project`
104− # ];
105− # modules = [{
106− # # Specific package overrides would go here for example:
107− # packages.cbors.package.ghcOptions = "-Werror";
108− # packages.cbors.patches = [ ./one.patch ];
109− # packages.cbors.flags.optimize-gmp = false;
110− # # It may be better to set flags in `cabal.project` instead
111− # # (`plan-to-nix` will include them as defaults).
112− # }];
113− }
114−```
115−
116−Note: The `cleanGit` call will exclude any files not in the index file
117−in the local `.git` directory. This is extremely useful as it avoids
118−unwanted builds (for instance when the contents of `dist-newstyle` are
119−modified by cabal). It is important that `src` is the root directory
120−of the repo (so `cleanGit` can find the `.git` directory). If the project
121−is not at the root of the repo, then also pass `subDir` to `cleanGit` with the
122−location of the project relative to `src` as a string ([more information
123−on using cleanGit](clean-git.md)). For example:
124−
125−```
126− src = pkgs.haskell-nix.haskellLib.cleanGit
127− { src = ./.; subDir = "subdir/another-subdir"; };
128−```
129−
130−If you want to use a custom filtering function, don't use the built-in nix `filterSource` function.
131−Due to some technicalities about how filtering and the nix store work, it will cause all components in
132−your project to be rebuilt any time any part of the project source changes. Use `cleanSourceWith` instead:
133−
134−```
135− src = pkgs.haskell-nix.haskellLib.cleanSourceWith
136− { src = ./.; filter = myFilterFunction; };
137−```
138−
139−Note that `cleanSourceWith` will also take the `subDir` argument.
140−
141−You can build a component from your project with `nix-build` (in this
142−case the `hello` executable in a `helloworld` package):
143−
144−```bash
145−nix-build -A helloworld.components.exes.hello
146−```
147−
148−For interactive development you can run:
149−
150−```bash
151−nix-shell -A shellFor
152−```
153−
154−The resulting shell will include all the dependencies of the local packages
155−listed in your `cabal.project` file (but it will not build those local
156−packages).
157−
158−Inside the shell use `cabal new-build` and `cabal new-repl` to work on the
159−cabal project as you normally would. They will use the packages provided
160−by nix whenever possible.
161−
162−It is a good idea to add `write-ghc-environment-files: never` to your
163−`cabal.project` file to prevent unwanted `.ghc.environment.*` files
164−(they will prevent subsequent `nix-shell` invocations from working
165−properly).
166−
167−Adding an `index-state` to your `cabal.project` can pin the plan used so that
168−the same packages will be built each time (until you change the index-state
169−or one of the constraints in your local `.cabal` files).
170−
171−### Using your stack.yaml file
172−
173−If your project has a `stack.yaml` you can add a `default.nix` like this:
174−
175−```nix
176−{ pkgs ? import <nixpkgs> (import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz) {}).nixpkgsArgs
177−}:
178− pkgs.haskell-nix.stackProject {
179− src = pkgs.haskell-nix.haskellLib.cleanGit { src = ./.; };
180− # pkg-def-extras = [
181− # # Additional packages ontop of all those listed in `stack.yaml`
182− # ];
183− # modules = [
184− # # Specific package overrides would go here for example:
185− # packages.cbors.package.ghcOptions = "-Werror";
186− # packages.cbors.patches = [ ./one.patch ];
187− # packages.cbors.flags.optimize-gmp = false;
188− # # It may be better to set flags in `stack.yaml` instead
189− # # (`stack-to-nix` will include them as defaults).
190− # ];
191− }
192−```
193−
194−You can build a component from your project with `nix-build` (in this
195−case the `hello` executable in a `helloworld` package):
196−
197−```bash
198−nix-build -A helloworld.components.exes.hello
199−```
200−
201−### Pinning the [Haskell.nix][] version
202−
203−For simplicity's sake we will use `fetchTarball` for the examples in
204−this documentation. This will always get the latest version, and is
205−similar to an auto-updating Nix channel.
206−
207−However, in your own project, you may wish to pin [Haskell.nix][] (as
208−you would pin Nixpkgs). This will make your builds reproducable, more
209−predictable, and faster (because the fixed version is cached).
210−
211−One way of doing this is to use `nix-prefetch-git` to get a JSON file
212−with a revision and SHA-256 hash of [Haskell.nix][].
213−
214−```
215−$ nix-prefetch-git --quiet https://github.com/input-output-hk/haskell.nix | tee haskell-nix-src.json
216−{
217− "url": "https://github.com/input-output-hk/haskell.nix",
218− "rev": "f1a94a4c82a2ab999a67c3b84269da78d89f0075",
219− "date": "2019-06-05T01:06:12+00:00",
220− "sha256": "0ggxsppjlb6q6a83y12cwgrdnqnw1s128rpibgzs5p1966bdfqla",
221− "fetchSubmodules": false
222−}
223−```
224−
225−(The `tee` command is just to show you the result.)
226−Use the following expression to import that version:
227−
228−```nix
229−{ nixpkgs ? <nixpkgs> }:
230−
231−let
232− spec = builtins.fromJSON (builtins.readFile ./haskell-nix-src.json);
233− haskell-nix-src = (import nixpkgs {}).fetchgit {
234− name = "haskell-lib";
235− inherit (spec) url rev sha256 fetchSubmodules;
236− };
237−in
238− import nixpkgs (import haskell-nix-src)
239−```
240−
241−There are other possible schemes for pinning. See
242−[`haskell.nix/lib/fetch-external.nix`](https://github.com/input-output-hk/haskell.nix/blob/master/lib/fetch-external.nix),
243−the [niv](https://github.com/nmattia/niv) tool, or the Nix Flakes
244−proposal.
245−
246−### Overriding the Hackage version
247−
248−Sometimes you might want to use a chosen version of Haskell.nix with a
249−recent update of Hackage or Stackage. This can be done with JSON pins:
250−
251−```bash
252−nix-prefetch-git https://github.com/input-output-hk/hackage.nix | tee hackage-src.json
253−nix-prefetch-git https://github.com/input-output-hk/stackage.nix | tee stackage-src.json
254−```
255−
256−The resulting JSON files will correspond to the latest revision of
257−[hackage.nix][] and [stackage.nix][]. See
258−[Architecture](architecture.md) for more information about how
259−these Git repositories correspond to the actual Hackage and Stackage.
260−
261−[hackage.nix]: https://github.com/input-output-hk/hackage.nix
262−[stackage.nix]: https://github.com/input-output-hk/stackage.nix
263−
264−```nix
265−{ pkgs ? import <nixpkgs> (haskellNixArgs // { overlays = haskellNixArgs.overlays ++ [
266− (self: super: {
267− haskell-nix = super.haskell-nix // {
268− hackageSourceJSON = ./hackage-src.json;
269− stackageSourceJSON = ./stackage-src.json;
270− };
271− })]; })
272−, haskellNixArgs ? (import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz) {}).nixpkgsArgs
273−}:
274− pkgs
275−```
276−
277−## Using `nix repl`
278−
279−It's sometimes useful to load [Haskell.nix][] in the REPL to explore
280−attrsets and try examples.
281−
282−```
283−# example.nix
284−{ nixpkgs ? <nixpkgs> }:
285−rec {
286− haskell = import nixpkgs (import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz) {}).nixpkgsArgs;
287− pkgNames = haskell.pkgs.lib.attrNames haskell.haskell-nix.snapshots."lts-13.18";
288−}
289−```
290−
291−Load the example file:
292−
293−```
294−$ nix repl '<nixpkgs>' example.nix
295−Welcome to Nix version 2.3pre6631_e58a7144. Type :? for help.
296−
297−Loading '<nixpkgs>'...
298−Added 10403 variables.
299−
300−Loading 'example2.nix'...
301−Added 2 variables.
302−
303−nix-repl> lib.take 5 pkgNames
304−[ "ALUT" "ANum" "Allure" "Boolean" "BoundedChan" ]
305−
306−nix-repl>
307−```
308−
309−Now that you have `nix-tools` and are able to import [Haskell.nix][],
310−you can continue to the next chapter.
docs/user-guide/cabal-projects.mddeleted−96
@@ -1,96 +0,0 @@
1−Here we will look into how to generate the `pkgs.nix` file for a
2−`cabal.project` project. For the full integration see the [previous
3−page](./projects.md).
4−
5−Generating package sets for Cabal projects, is slightly more involved,
6−because you need to let Cabal calculate a build plan for the
7−dependencies of your package(s).
8−
9−## Generating `plan.json`
10−
11−To get a plan, you need Cabal and GHC. See the [How to install a
12−compiler section of the Nixpkgs Manual][compiler] for information
13−about how to choose a specific compiler version.
14−
15−[compiler]: https://nixos.org/nixpkgs/manual/#how-to-install-a-compiler
16−
17−!!! note "Cabal version"
18− The minimum Cabal version is 2.4. This version is available
19− in the NixOS 19.03 release.
20−
21−For this example, we will run a `nix-shell` with the default GHC
22−version for Nixpkgs.
23−
24−```bash
25−nix-shell -p haskellPackages.cabal-install haskellPackages.ghc \
26− --run "cabal new-configure"
27−```
28−
29−If all goes well, you should now have the file
30−`dist-newstyle/cache/plan.json`.
31−
32−!!! tip "Specifying the GHC version"
33− To use a specific compiler version, replace `haskellPackages.ghc`
34− with something like `haskell-nix.compiler.ghc865`. The given compiler
35− must exist in your Nixpkgs version, of course. See also the
36− [Nixpkgs Manual][compiler].
37−
38−## Using `plan-to-nix`
39−
40−With [nix-tools installed](../user-guide.md), we can then run the
41−following command on a Cabal project and its build plan. Omit the
42−`--cabal-project` option if you don't have a project file.
43−
44−```bash
45−# convert the plan.json file into a pkgs.nix file
46−plan-to-nix --output . \
47− --plan-json dist-newstyle/cache/plan.json
48− --cabal-project cabal.project
49−```
50−
51−This will produce a `pkgs.nix` file that looks like the following:
52−
53−```nix
54−{
55− pkgs = hackage:
56− {
57− packages = {
58− "o-clock" = hackage.o-clock."0.1.1".revisions.default;
59− ...
60− };
61− compiler = { ... };
62− };
63−
64− extras = hackage:
65− { packages = { my-package = ./.plan.nix/my-package.nix; }; };
66−}
67−```
68−
69−It has converted Cabal's build plan into a Nix expression that selects
70−dependencies from `hackage.nix`. All local packages in the project are
71−generated with `cabal-to-nix` and added to the package set
72−description.
73−
74−## Creating the package set
75−
76−Import the generated `pkgs.nix` and pass to
77−[`mkCabalPkgSet`](../reference/library.md#mkcabalprojectpkgset) to
78−instantiate a package set.
79−
80−```nix
81−# default.nix
82−let
83− # Import the Haskell.nix library,
84− haskellNix = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz) {};
85− nixpkgs = import haskellNix.sources.nixpkgs-1909 haskellNix.nixpkgsArgs;
86− haskell = nixpkgs.haskell-nix;
87−
88− # Instantiate a package set using the generated file.
89− pkgSet = haskell.mkCabalProjectPkgSet {
90− plan-pkgs = import ./pkgs.nix;
91− pkg-def-extras = [];
92− modules = [];
93− };
94−in
95− pkgSet.config.hsPkgs
96−```
docs/user-guide/projects.mddeleted−84
@@ -1,84 +0,0 @@
1−# How to replace IFDs with intermediate nix files
2−
3−We believe that imports from derivations (IFDs) provide tremendous
4−value in nix and the aversion towards them stems mostly from
5−poor tooling and ci support for them. We do not believe
6−that poor tooling or ci support should cripple nix capability
7−of abstraction. Hence haskell.nix makes excessive use of
8−IFDs.
9−
10−We do note however that there are users who prefer to
11−have IFD-free expressions. For this group of users we
12−detail how to expand the IFD dependent high level functions
13−into their IFD free building blocks.
14−
15−The general structure will be the same, independent of the use of
16−Stack or Cabal.
17−
18−Let us assume for now that we have already generated a `pkgs.nix`
19−expression (see the links bellow). The following file then produces a package set:
20−
21−```nix
22−# default.nix
23−let
24− # Import the Haskell.nix library,
25− pkgs = import <nixpkgs> (import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz) {}).nixpkgsArgs;
26−
27− # Import the file you will create in the stack-to-nix or cabal-to-nix step.
28− my-pkgs = import ./pkgs.nix;
29−
30− # Stack projects use this:
31− pkgSet = pkgs.haskell-nix.mkStackPkgSet {
32− stack-pkgs = my-pkgs;
33− pkg-def-extras = [
34− # these extras will provide additional packages
35− # ontop of the package set. E.g. extra-deps
36− # for stack packages. or local packages for
37− # cabal.projects
38− ];
39− modules = [
40− # specific package overrides would go here
41− # example:
42− # packages.cbors.package.ghcOptions = "-Werror";
43− # packages.cbors.patches = [ ./one.patch ];
44− # packages.cbors.flags.optimize-gmp = false;
45− # It may be better to set flags in stack.yaml instead
46− # (`stack-to-nix` will include them as defaults).
47− ];
48− };
49−
50− # Cabal projects use this:
51− pkgSet = pkgs.haskell-nix.mkCabalProjectPkgSet {
52− plan-pkgs = my-pkgs;
53− pkg-def-extras = [];
54− modules = [
55− # specific package overrides would go here
56− # example:
57− # packages.cbors.package.ghcOptions = "-Werror";
58− # packages.cbors.patches = [ ./one.patch ];
59− # packages.cbors.flags.optimize-gmp = false;
60− # It may be better to set flags in `cabal.project` instead
61− # (`plan-to-nix` will include them as defaults).
62− ];
63− };
64−
65−in pkgSet.config.hsPkgs // { _config = pkgSet.config; }
66−```
67−
68−With this setup you can then start building the components of
69−interest:
70−
71−```bash
72−nix build -f default.nix $pkg.components.library
73−```
74−
75−to build the library for `$pkg` or
76−
77−```bash
78−nix build -f default.nix $pkg.components.exes.$exe
79−```
80−
81−to build a specific executable. The same holds for test suites and benchmarks.
82−
83−- [Generating a `pkgs.nix` for a Stack project](./stack-projects.md)
84−- [Generating a `pkgs.nix` for a Cabal project](./cabal-projects.md)
docs/user-guide/stack-projects.mddeleted−58
@@ -1,58 +0,0 @@
1−Here we will look into how to generate the `pkgs.nix` file for a
2−`stack.yaml` project. For the full integration see the
3−[previous page](./projects.md).
4−
5−## Using `stack-to-nix`
6−
7−With [nix-tools installed](../user-guide.md), we can simply run the
8−following command on a stack project:
9−
10−```bash
11−stack-to-nix --output . --stack-yaml stack.yaml
12−```
13−
14−This will produce a `pkgs.nix` file that looks like the following:
15−```nix
16−{
17− resolver = "lts-12.17";
18− extras = hackage:
19− {
20− packages = {
21− "o-clock" = hackage.o-clock."0.1.1".revisions.default;
22− ...
23− } // {
24− my-package = ./my-package.nix;
25− ...
26− };
27− };
28−}
29−```
30−
31−This file contains the stackage resolver, as well as set of extra
32−packages. The extras specifies which `extra-deps` (here:
33−`o-clock-0.1.1`) we wanted to add over the stackage snapshot, and what
34−local packages we want (here: `my-package`).
35−
36−## Creating the package set
37−
38−Import the generated `pkgs.nix` and pass to
39−[`mkStackPkgSet`](../reference/library.md#mkstackpkgset) to
40−instantiate a package set.
41−
42−```nix
43−# default.nix
44−let
45− # Import the Haskell.nix library,
46− haskellNix = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz) {};
47− nixpkgs = import haskellNix.sources.nixpkgs-1909 haskellNix.nixpkgsArgs;
48− haskell = nixpkgs.haskell-nix;
49−
50− # Instantiate a package set using the generated file.
51− pkgSet = haskell.mkStackPkgSet {
52− stack-pkgs = import ./pkgs.nix;
53− pkg-def-overlays = [];
54− modules = [];
55− };
56−in
57− pkgSet.config.hsPkgs
58−```
mkdocs.yml+9−9
@@ -26,14 +26,15 @@ pages:
2626 - 'Introduction': index.md
2727 - 'Motivation': motivation.md
2828 - 'Architecture': architecture.md
29− - 'Getting Started': user-guide.md
30− - 'User Guide':
31− - 'Creating Nix builds for your projects': user-guide/projects.md
32− - 'Stack Projects': user-guide/stack-projects.md
33− - 'Cabal Projects': user-guide/cabal-projects.md
34− - 'Hackage and Stackage': user-guide/hackage-and-stackage.md
35− - 'How to create a development environment': user-guide/development.md
36− - 'How to cross-compile your project': user-guide/cross-compilation.md
29+ - 'Tutorials':
30+ - 'Getting Started': tutorials/getting-started.md
31+ - 'Creating a development environment': tutorials/development.md
32+ - 'Sourcing files only part of git repository using cleanGit': tutorials/clean-git.md
33+ - 'Mapping non-Haskell dependencies to Nixpkgs': tutorials/pkg-map.md
34+ - 'Bumping Hackage and Stackage snapshots': tutorials/hackage-stackage.md
35+ - 'Cross-compiling your project': tutorials/cross-compilation.md
36+ - 'Installing nix-tools': tutorials/installing-nix-tools.md
37+ - 'Manually generating Nix expressions': tutorials/manually-generating-nix-expressions.md
3738 - 'Reference':
3839 - 'Command-line tools': reference/commands.md
3940 - 'Haskell.nix Library': reference/library.md
@@ -43,7 +44,6 @@ pages:
4344 - 'Dev Notes':
4445 - 'Architecture': dev/dev-architecture.md
4546 - 'Maintainer Scripts': dev/maintainer-scripts.md
46− - 'Mapping non-Haskell dependencies to Nixpkgs': dev/pkg-map.md
4747 - 'Nixpkgs Pin': dev/nixpkgs-pin.md
4848 - 'Removing withPackage wrapper': dev/removing-with-package-wrapper.md
4949 - 'Test Suite': dev/tests.md