@@ -42,18 +42,27 @@ system.
43## Haskell Package description
43## Haskell Package description
45+The _Haskell package descriptions_ are values of the
46+`pkgSet.config.packages` attrset. These are not derivations, but just
45−Options for building a package. (todo: more info)
47+the configuration for building an individual package. The
48+configuration options are described under `packages.<name>` in [Module
49+options](./modules.md).
47## Component description
51## Component description
49−Options for building a component. (todo: more info)
53+The _component descriptions_ are values of the
54+`pkgSet.config.packages.<package>.components` attrset. These are not
55+derivations, but just the configuration for building an individual
56+component. The configuration options are described under
57+`packages.<name>.components.*` in [Module options](./modules.md).
51## Haskell Package
60## Haskell Package
62+In [Haskell.nix][], a _Haskell package_ is a derivation which has a
53−A derivation which has a `components` attribute. This derivation is
63+`components` attribute. This derivation is actually just for the
54−actually just for the package `Setup.hs` script, and isn't very
64+package `Setup.hs` script, and isn't very interesting. To actually use
55−interesting. To actually use the package, look within the components
65+the package, look within the components structure.
59components = {
68components = {
@@ -67,14 +76,44 @@ components = {
68## Component
77## Component
79+In [Haskell.nix][], a _component_ is a derivation corresponding to a
80+[Cabal component](https://www.haskell.org/cabal/users-guide/developing-packages.html)
83+[Haskell.nix][] also defines a special `all` component, which is the
84+union of all components in the package.
70## Identifier
86## Identifier
72A package identifier is an attrset pair of `name` and `version`.
88A package identifier is an attrset pair of `name` and `version`.
92+Extras allow adding more packages to the package set. These will be
93+functions taking a single parameter `hackage`. They should return an
94+attrset of package descriptions.
98+Modules are the primary method of configuring building of the package
101+1. an attrset containing [option declarations](./options.md), or
102+2. a function that returns an attrset containing option declarations.
104+If using the function form of a module, the following named parameters
105+will be passed to it:
107+| Argument | Type | Description |
108+|------------------|------|---------------------|
109+| `haskellLib` | attrset | The [haskellLib](#haskelllib) utility functions. |
110+| `pkgs` | | The Nixpkgs collection. |
111+| `pkgconfPkgs` | | A mapping of cabal build-depends names to Nixpkgs packages. (TODO: more information about this) |
112+| `buildModules` | | |
78# Top-level attributes
117# Top-level attributes
80## mkStackPkgSet
119## mkStackPkgSet
@@ -126,7 +165,11 @@ This is an attrset of `hsPkgs` packages from Stackage.
127## haskellPackages
166## haskellPackages
129−A `hsPkgs` package set
168+A `hsPkgs` package set, which is one of the recent LTS Haskell
169+releases from [`snapshots`](#snapshots).
171+The chosen LTS is updated occasionally in [Haskell.nix][], though a
131## nix-tools
174## nix-tools
@@ -145,6 +188,10 @@ A derivation containing the `nix-tools` [command-line tools](commands.md).
146## haskellLib
189## haskellLib
191+Assorted functions for operating on [Haskell.nix][] data. This is
192+distinct from `pkgs.haskell.lib` in the current Nixpkgs Haskell
148# Package-set functions
195# Package-set functions
150These functions exist within the `hsPkgs` package set.
197These functions exist within the `hsPkgs` package set.
@@ -152,8 +199,8 @@ These functions exist within the `hsPkgs` package set.
152## shellFor
199## shellFor
154Create a `nix-shell` [development
201Create a `nix-shell` [development
155−environment](../user-guide/development.md) *for* developing one or
202+environment](../user-guide/development.md) for developing one or more
156−more packages.
203+packages.
159shellFor =
206shellFor =
@@ -171,7 +218,24 @@ shellFor =
172## ghcWithPackages
219## ghcWithPackages
221+Creates a `nix-shell` [development
222+environment](../user-guide/development.md) including the given
223+packages selected from this package set.
225+**Parameter**: a package selection function.
227+**Return value**: a derivation
232+haskell.haskellPackages.ghcWithPackages (ps: with ps; [ lens conduit ])
174## ghcWithHoogle
235## ghcWithHoogle
237+The same as `ghcWithPackages`, except, a `hoogle` command with a
238+Hoogle documentation index of the packages will be included in the
177[haskell.nix]: https://github.com/input-output-hk/haskell.nix
241[haskell.nix]: https://github.com/input-output-hk/haskell.nix