1[Haskell.nix][] contains a library of functions for creating buildable
2package sets from their Nix expression descriptions. The library is
3what you get when importing [Haskell.nix][]. It might be helpful to
4load the library in the [Nix REPL](../user-guide.md#using-nix-repl) to
7 * [Types](#types) — the kinds of data that you will encounter working with [Haskell.nix][].
8 * [Top-level attributes](#top-level-attributes) — Functions and derivations defined in the Haskell.nix attrset.
9 * [Package-set functions](#package-set-functions) — Helper functions defined on the `hsPkgs` package set.
15The result of `mkPkgSet`. This is an application of the NixOS module
33| Attribute | Type | Description |
34|----------------|------|-----------------------------------------------------|
35| `options` | Module options | The combination of all options set through the `modules` argument passed to `mkPkgsSet`. |
36| `config` | | The result of evaluating and applying the `options` with [Haskell.nix][] |
37| `.hsPkgs` | Attrset of [Haskell Packages](#haskell-package) | Buildable packages, created from `packages` |
38| `.packages` | Attrset of [Haskell Package descriptions](#haskell-package-descriptions) | Configuration for each package in `hsPkgs` |
39| `.compiler` | Attrset | |
43## Haskell Package description
45Options for building a package. (todo: more info)
47## Component description
49Options for building a component. (todo: more info)
53A derivation which has a `components` attribute. This derivation is
54actually just for the package `Setup.hs` script, and isn't very
55interesting. To actually use the package, look within the components
61 exes = { NAME = COMPONENT; };
62 tests = { NAME = COMPONENT; };
63 benchmarks = { NAME = COMPONENT; };
72A package identifier is an attrset pair of `name` and `version`.
82Creates a [package set](#package-set) based on the `pkgs.nix` output
87 { stack-pkgs, pkg-def-extras ? [], modules ? []}: ...
90| Argument | Type | Description |
91|------------------|------|---------------------|
92| `stack-pkgs` | | `import ./pkgs.nix` — The imported file generated by `stack‑to‑nix`. |
93| `pkg‑def‑extras` | List of [Extras](#extras) | For overriding the package set. |
94| `modules` | List of [Modules](#modules) | For overriding the package set. |
96**Return value**: a [`pkgSet`](#package-set)
98## mkCabalProjectPkgSet
100Creates a [package set](#package-set) based on the `pkgs.nix` output
104mkCabalProjectPkgSet =
105 { plan-pkgs, pkg-def-extras ? [], modules ? []}: ...
108| Argument | Type | Description |
109|------------------|------|---------------------|
110| `plan-pkgs` | | `import ./pkgs.nix` — The imported file generated by `plan‑to‑nix`. |
111| `pkg‑def‑extras` | List of [Extras](#extras) | For overriding the package set. |
112| `modules` | List of [Modules](#modules) | For overriding the package set. |
114**Return value**: a [`pkgSet`](#package-set)
118This is the base function used by both `mkStackPkgSet` and
119`mkCabalProjectPkgSet`.
121**Return value**: a [`pkgSet`](#package-set)
125This is an attrset of `hsPkgs` packages from Stackage.
129A `hsPkgs` package set
133A derivation containing the `nix-tools` [command-line tools](commands.md).
137## callCabalProjectToNix
148# Package-set functions
150These functions exist within the `hsPkgs` package set.
154Create a `nix-shell` [development
155environment](../user-guide/development.md) *for* developing one or
160 { packages, withHoogle ? true, ...}: ...
164| Argument | Type | Description |
165|----------------|------|---------------------|
166| `packages` | Function | Package selection function. It takes a list of [Haskell packages](#haskell-package) and returns a subset of these packages. |
167| `withHoogle` | Boolean | Whether to build a Hoogle documentation index and provide the `hoogle` command. |
168| `{ ... }` | Attrset | All the other arguments are passed to [`mkDerivation`](https://nixos.org/nixpkgs/manual/#sec-using-stdenv). |
170**Return value**: a derivation
177[haskell.nix]: https://github.com/input-output-hk/haskell.nix
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list