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
11The result of `mkPkgSet`. This is an application of the NixOS module
29| Attribute | Type | Description |
30|----------------|------|-----------------------------------------------------|
31| `options` | Module options | The combination of all options set through the `modules` argument passed to `mkPkgsSet`. |
32| `config` | | The result of evaluating and applying the `options` with [Haskell.nix][] |
33| `.hsPkgs` | Attrset of [Haskell Packages](#haskell-package) | Buildable packages, created from `packages` |
34| `.packages` | Attrset of [Haskell Package descriptions](#haskell-package-descriptions) | Configuration for each package in `hsPkgs` |
35| `.compiler` | Attrset | |
39## Haskell Package description
41Options for building a package. (todo: more info)
43## Component description
45Options for building a component. (todo: more info)
49A derivation which has a `components` attribute. This derivation is
50actually just for the package `Setup.hs` script, and isn't very
51interesting. To actually use the package, look within the components
57 exes = { NAME = COMPONENT; };
58 tests = { NAME = COMPONENT; };
59 benchmarks = { NAME = COMPONENT; };
68A package identifier is an attrset pair of `name` and `version`.
78Creates a [package set](#package-set) based on the `pkgs.nix` output
83 { stack-pkgs, pkg-def-extras ? [], modules ? []}: ...
86| Argument | Type | Description |
87|------------------|------|---------------------|
88| `stack-pkgs` | | `import ./pkgs.nix` — The imported file generated by `stack‑to‑nix`. |
89| `pkg‑def‑extras` | List of [Extras](#extras) | For overriding the package set. |
90| `modules` | List of [Modules](#modules) | For overriding the package set. |
92**Return value**: a [`pkgSet`](#package-set)
94## mkCabalProjectPkgSet
96Creates a [package set](#package-set) based on the `pkgs.nix` output
100mkCabalProjectPkgSet =
101 { plan-pkgs, pkg-def-extras ? [], modules ? []}: ...
104| Argument | Type | Description |
105|------------------|------|---------------------|
106| `plan-pkgs` | | `import ./pkgs.nix` — The imported file generated by `plan‑to‑nix`. |
107| `pkg‑def‑extras` | List of [Extras](#extras) | For overriding the package set. |
108| `modules` | List of [Modules](#modules) | For overriding the package set. |
110**Return value**: a [`pkgSet`](#package-set)
114This is the base function used by both `mkStackPkgSet` and
115`mkCabalProjectPkgSet`.
117**Return value**: a [`pkgSet`](#package-set)
121This is an attrset of `hsPkgs` packages from Stackage.
125A `hsPkgs` package set
129A derivation containing the `nix-tools` [command-line tools](commands.md).
133## callCabalProjectToNix
144# Package-set functions
146These functions exist within the `hsPkgs` package set.
150Create a `nix-shell` [development
151environment](../user-guide/development.md) *for* developing one or
156 { packages, withHoogle ? true, ...}: ...
160| Argument | Type | Description |
161|----------------|------|---------------------|
162| `packages` | Function | Package selection function. It takes a list of [Haskell packages](#haskell-package) and returns a subset of these packages. |
163| `withHoogle` | Boolean | Whether to build a Hoogle documentation index and provide the `hoogle` command. |
164| `{ ... }` | Attrset | All the other arguments are passed to [`mkDerivation`](https://nixos.org/nixpkgs/manual/#sec-using-stdenv). |
166**Return value**: a derivation
173[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