3 The Haskell infrastructure in Nixpkgs has two main purposes: The primary purpose
4 is to provide a Haskell compiler and build tools as well as infrastructure for
5 packaging Haskell-based packages.
7 The secondary purpose is to provide support for Haskell development environments
8 including prebuilt Haskell libraries. However, in this area sacrifices have been
9 made due to self-imposed restrictions in Nixpkgs, to lessen the maintenance
10 effort and to improve performance. (More details in the subsection
11 [Limitations.](#haskell-limitations))
13 ## Available packages {#haskell-available-packages}
15 The compiler and most build tools are exposed at the top level:
17 * `ghc` is the default version of GHC
18 * Language specific tools: `cabal-install`, `stack`, `hpack`, …
20 Many “normal” user facing packages written in Haskell, like `niv` or `cachix`,
21 are also exposed at the top level, and there is nothing Haskell specific to
22 installing and using them.
24 All of these packages are originally defined in the `haskellPackages` package set.
25 The same packages are re-exposed with a reduced dependency closure for convenience (see `justStaticExecutables` or `separateBinOutput` below).
28 See [](#chap-language-support) for techniques to explore package sets.
31 The `haskellPackages` set includes at least one version of every package from [Hackage](https://hackage.haskell.org/) as well as some manually injected packages.
33 The attribute names in `haskellPackages` always correspond with their name on
34 Hackage. Since Hackage allows names that are not valid Nix without escaping,
35 you need to take care when handling attribute names like `3dmodels`.
37 For packages that are part of [Stackage] (a curated set of known to be
38 compatible packages), we use the version prescribed by a Stackage snapshot
39 (usually the current LTS one) as the default version. For all other packages we
40 use the latest version from [Hackage](https://hackage.org) (the repository of
41 basically all open source Haskell packages). See [below](#haskell-available-versions) for a few more details on this.
43 Roughly half of the 16K packages contained in `haskellPackages` don’t actually
44 build and are [marked as broken semi-automatically](https://github.com/NixOS/nixpkgs/blob/haskell-updates/pkgs/development/haskell-modules/configuration-hackage2nix/broken.yaml).
45 Most of those packages are deprecated or unmaintained, but sometimes packages
46 that should build, do not build. Very often fixing them is not a lot of work.
49 TODO(@sternenseemann):
50 How you can help with that is
51 described in [Fixing a broken package](#haskell-fixing-a-broken-package).
54 `haskellPackages` is built with our default compiler, but we also provide other releases of GHC and package sets built with them.
55 Available compilers are collected under `haskell.compiler`.
57 Each of those compiler versions has a corresponding attribute set `packages` built with
58 it. However, the non-standard package sets are not tested regularly and, as a
59 result, contain fewer working packages. The corresponding package set for GHC
60 9.4.5 is `haskell.packages.ghc945`. In fact `haskellPackages` is just an alias
61 for `haskell.packages.ghc964`:
63 Every package set also re-exposes the GHC used to build its packages as `haskell.packages.*.ghc`.
65 ### Available package versions {#haskell-available-versions}
67 We aim for a “blessed” package set which only contains one version of each
68 package, like [Stackage], which is a curated set of known to be compatible
69 packages. We use the version information from Stackage snapshots and extend it
70 with more packages. Normally in Nixpkgs the number of building Haskell packages
71 is roughly two to three times the size of Stackage. For choosing the version to
72 use for a certain package we use the following rules:
74 1. By default, for `haskellPackages.foo` is the newest version of the package
75 `foo` found on [Hackage](https://hackage.org), which is the central registry
76 of all open source Haskell packages. Nixpkgs contains a reference to a pinned
77 Hackage snapshot, thus we use the state of Hackage as of the last time we
79 2. If the [Stackage] snapshot that we use (usually the newest LTS snapshot)
80 contains a package, [we use instead the version in the Stackage snapshot as
81 default version for that package.](https://github.com/NixOS/nixpkgs/blob/haskell-updates/pkgs/development/haskell-modules/configuration-hackage2nix/stackage.yaml)
82 3. For some packages, which are not on Stackage, we have if necessary [manual
83 overrides to set the default version to a version older than the newest on
84 Hackage.](https://github.com/NixOS/nixpkgs/blob/haskell-updates/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml)
85 4. For all packages, for which the newest Hackage version is not the default
86 version, there will also be a `haskellPackages.foo_x_y_z` package with the
87 newest version. The `x_y_z` part encodes the version with dots replaced by
88 underscores. When the newest version changes by a new release to Hackage the
89 old package will disappear under that name and be replaced by a newer one under
90 the name with the new version. The package name including the version will
91 also disappear when the default version e.g. from Stackage catches up with the
92 newest version from Hackage. E.g. if `haskellPackages.foo` gets updated from
93 1.0.0 to 1.1.0 the package `haskellPackages.foo_1_1_0` becomes obsolete and
95 5. For some packages, we also [manually add other `haskellPackages.foo_x_y_z`
96 versions](https://github.com/NixOS/nixpkgs/blob/haskell-updates/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml),
97 if they are required for a certain build.
99 Relying on `haskellPackages.foo_x_y_z` attributes in derivations outside
100 nixpkgs is discouraged because they may change or disappear with every package
102 <!-- TODO(@maralorn) We should add a link to callHackage, etc. once we added
103 them to the docs. -->
105 All `haskell.packages.*` package sets use the same package descriptions and the same sets
106 of versions by default. There are however GHC version specific override `.nix`
107 files to loosen this a bit.
109 ### Dependency resolution {#haskell-dependency-resolution}
111 Normally when you build Haskell packages with `cabal-install`, `cabal-install`
112 does dependency resolution. It will look at all Haskell package versions known
113 on Hackage and tries to pick for every (transitive) dependency of your build
114 exactly one version. Those versions need to satisfy all the version constraints
115 given in the `.cabal` file of your package and all its dependencies.
117 The [Haskell builder in nixpkgs](#haskell-mkderivation) does no such thing.
118 It will take as input packages with names off the desired dependencies
119 and just check whether they fulfill the version bounds and fail if they don’t
120 (by default, see `jailbreak` to circumvent this).
122 The `haskellPackages.callPackage` function does the package resolution.
123 It will, e.g., use `haskellPackages.aeson`which has the default version as
124 described above for a package input of name `aeson`. (More general:
125 `<packages>.callPackage f` will call `f` with named inputs provided from the
126 package set `<packages>`.)
127 While this is the default behavior, it is possible to override the dependencies
128 for a specific package, see
129 [`override` and `overrideScope`](#haskell-overriding-haskell-packages).
131 ### Limitations {#haskell-limitations}
133 Our main objective with `haskellPackages` is to package Haskell software in
134 nixpkgs. This entails some limitations, partially due to self-imposed
135 restrictions of nixpkgs, partially in the name of maintainability:
137 * Only the packages built with the default compiler see extensive testing of the
138 whole package set. For other GHC versions only a few essential packages are
140 * As described above we only build one version of most packages.
142 The experience using an older or newer packaged compiler or using different
143 versions may be worse, because builds will not be cached on `cache.nixos.org`
146 Thus, to get the best experience, make sure that your project can be compiled
147 using the default compiler of nixpkgs and recent versions of its dependencies.
149 A result of this setup is, that getting a valid build plan for a given
150 package can sometimes be quite painful, and in fact this is where most of the
151 maintenance work for `haskellPackages` is required. Besides that, it is not
152 possible to get the dependencies of a legacy project from nixpkgs or to use a
153 specific stack solver for compiling a project.
155 Even though we couldn’t use them directly in nixpkgs, it would be desirable
156 to have tooling to generate working Nix package sets from build plans generated
157 by `cabal-install` or a specific Stackage snapshot via import-from-derivation.
158 Sadly we currently don’t have tooling for this. For this you might be
159 interested in the alternative [haskell.nix] framework, which, be warned, is
160 completely incompatible with packages from `haskellPackages`.
162 <!-- TODO(@maralorn) Link to package set generation docs in the contributors guide below. -->
164 ## `haskellPackages.mkDerivation` {#haskell-mkderivation}
166 Every haskell package set has its own haskell-aware `mkDerivation` which is used
167 to build its packages. Generally you won't have to interact with this builder
168 since [cabal2nix](#haskell-cabal2nix) can generate packages
169 using it for an arbitrary cabal package definition. Still it is useful to know
170 the parameters it takes when you need to
171 [override](#haskell-overriding-haskell-packages) a generated Nix expression.
173 `haskellPackages.mkDerivation` is a wrapper around `stdenv.mkDerivation` which
174 re-defines the default phases to be haskell aware and handles dependency
175 specification, test suites, benchmarks etc. by compiling and invoking the
176 package's `Setup.hs`. It does *not* use or invoke the `cabal-install` binary,
177 but uses the underlying `Cabal` library instead.
179 ### General arguments {#haskell-derivation-args}
182 : Package name, assumed to be the same as on Hackage (if applicable)
185 : Packaged version, assumed to be the same as on Hackage (if applicable)
188 : Source of the package. If omitted, fetch package corresponding to `pname`
189 and `version` from Hackage.
192 : Hash to use for the default case of `src`.
195 : Revision number of the updated cabal file to fetch from Hackage.
196 If `null` (which is the default value), the one included in `src` is used.
199 : `sha256` hash of the cabal file identified by `revision` or `null`.
202 : Extra flags passed when executing the `configure` command of `Setup.hs`.
205 : Extra flags passed when executing the `build` command of `Setup.hs`.
208 : Extra flags passed to `Setup.hs haddock` when building the documentation.
211 : Whether to execute the package's test suite if it has one. Defaults to `true` unless cross-compiling.
214 : Whether to execute the package's benchmark if it has one. Defaults to `false`.
217 : Whether to generate an index file for [hoogle][hoogle] as part of
218 `haddockPhase` by passing the [`--hoogle` option][haddock-hoogle-option].
222 : Whether to generate an index for interactive navigation of the HTML documentation.
223 Defaults to `true` if supported.
225 `doInstallIntermediates`
226 : Whether to install intermediate build products (files written to `dist/build`
227 by GHC during the build process). With `enableSeparateIntermediatesOutput`,
228 these files are instead installed to [a separate `intermediates`
229 output.][multiple-outputs] The output can then be passed into a future build of
230 the same package with the `previousIntermediates` argument to support
231 incremental builds. See [“Incremental builds”](#haskell-incremental-builds) for
232 more information. Defaults to `false`.
234 `enableLibraryProfiling`
235 : Whether to enable [profiling][profiling] for libraries contained in the
236 package. Enabled by default if supported.
238 `enableExecutableProfiling`
239 : Whether to enable [profiling][profiling] for executables contained in the
240 package. Disabled by default.
243 : [Profiling detail level][profiling-detail] to set. Defaults to `exported-functions`.
245 `enableSharedExecutables`
246 : Whether to link executables dynamically. By default, executables are linked statically.
248 `enableSharedLibraries`
249 : Whether to build shared Haskell libraries. This is enabled by default unless we are using
250 `pkgsStatic` or shared libraries have been disabled in GHC.
252 `enableStaticLibraries`
253 : Whether to build static libraries. Enabled by default if supported.
255 `enableDeadCodeElimination`
256 : Whether to enable linker based dead code elimination in GHC.
257 Enabled by default if supported.
260 : Whether to pass `--via-asm` to `hsc2hs`. Enabled by default only on Windows.
263 : Whether to render the source as well as part of the haddock documentation
264 by passing the [`--hyperlinked-source` flag][haddock-hyperlinked-source-option].
268 : Whether the package contains an executable.
271 : Whether the package contains a library.
274 : Whether to execute [jailbreak-cabal][jailbreak-cabal] before `configurePhase`
275 to lift any version constraints in the cabal file. Note that this can't
276 lift version bounds if they are conditional, i.e. if a dependency is hidden
279 `enableParallelBuilding`
280 : Whether to use the `-j` flag to make GHC/Cabal start multiple jobs in parallel.
283 : Upper limit of jobs to use in parallel for compilation regardless of
284 `$NIX_BUILD_CORES`. Defaults to 16 as Haskell compilation with GHC currently
285 sees a [performance regression](https://gitlab.haskell.org/ghc/ghc/-/issues/9221)
286 if too many parallel jobs are used.
289 : Whether to generate and install files needed for [HPC][haskell-program-coverage].
293 : Whether to build (HTML) documentation using [haddock][haddock].
294 Defaults to `true` if supported.
297 : Name of the test suite to build and run. If unset, all test suites will be executed.
299 `preCompileBuildDriver`
300 : Shell code to run before compiling `Setup.hs`.
302 `postCompileBuildDriver`
303 : Shell code to run after compiling `Setup.hs`.
306 : Shell code to run before building documentation using haddock.
309 : Shell code to run after building documentation using haddock.
312 : Whether to only allow core libraries to be used while building `Setup.hs`.
316 : Whether to enable the [cpphs][cpphs] preprocessor. Defaults to `false`.
318 `enableSeparateBinOutput`
319 : Whether to install executables to a separate `bin` output. Defaults to `false`.
321 `enableSeparateDataOutput`
322 : Whether to install data files shipped with the package to a separate `data` output.
325 `enableSeparateDocOutput`
326 : Whether to install documentation to a separate `doc` output.
327 Is automatically enabled if `doHaddock` is `true`.
329 `enableSeparateIntermediatesOutput`
330 : When `doInstallIntermediates` is true, whether to install intermediate build
331 products to a separate `intermediates` output. See [“Incremental
332 builds”](#haskell-incremental-builds) for more information. Defaults to
335 `allowInconsistentDependencies`
336 : If enabled, allow multiple versions of the same Haskell package in the
337 dependency tree at configure time. Often in such a situation compilation would
338 later fail because of type mismatches. Defaults to `false`.
340 `enableLibraryForGhci`
341 : Build and install a special object file for GHCi. This improves performance
342 when loading the library in the REPL, but requires extra build time and
343 disk space. Defaults to `false`.
345 `previousIntermediates`
346 : If non-null, intermediate build artifacts are copied from this input to
347 `dist/build` before performing compiling. See [“Incremental
348 builds”](#haskell-incremental-builds) for more information. Defaults to `null`.
351 : Name of the executable or library to build and install.
352 If unset, all available targets are built and installed.
354 ### Specifying dependencies {#haskell-derivation-deps}
356 Since `haskellPackages.mkDerivation` is intended to be generated from cabal
357 files, it reflects cabal's way of specifying dependencies. For one, dependencies
358 are grouped by what part of the package they belong to. This helps to reduce the
359 dependency closure of a derivation, for example benchmark dependencies are not
360 included if `doBenchmark == false`.
363 : dependencies necessary to compile `Setup.hs`
366 : dependencies of a library contained in the package
369 : dependencies of an executable contained in the package
372 : dependencies of a test suite contained in the package
375 : dependencies of a benchmark contained in the package
377 The other categorization relates to the way the package depends on the dependency:
380 : Tools we need to run as part of the build process.
381 They are added to the derivation's `nativeBuildInputs`.
384 : Haskell libraries the package depends on.
385 They are added to `propagatedBuildInputs`.
388 : Non-Haskell libraries the package depends on.
389 They are added to `buildInputs`
392 : `*SystemDepends` which are discovered using `pkg-config`.
393 They are added to `buildInputs` and it is additionally
394 ensured that `pkg-config` is available at build time.
397 : Apple SDK Framework which the package depends on when compiling it on Darwin.
399 Using these two distinctions, you should be able to categorize most of the dependency
400 specifications that are available:
401 `benchmarkFrameworkDepends`,
402 `benchmarkHaskellDepends`,
403 `benchmarkPkgconfigDepends`,
404 `benchmarkSystemDepends`,
405 `benchmarkToolDepends`,
406 `executableFrameworkDepends`,
407 `executableHaskellDepends`,
408 `executablePkgconfigDepends`,
409 `executableSystemDepends`,
410 `executableToolDepends`,
411 `libraryFrameworkDepends`,
412 `libraryHaskellDepends`,
413 `libraryPkgconfigDepends`,
414 `librarySystemDepends`,
415 `libraryToolDepends`,
416 `setupHaskellDepends`,
417 `testFrameworkDepends`,
418 `testHaskellDepends`,
419 `testPkgconfigDepends`,
420 `testSystemDepends` and
423 That only leaves the following extra ways for specifying dependencies:
426 : Allows specifying Haskell dependencies which are added to `propagatedBuildInputs` unconditionally.
429 : Like `*ToolDepends`, but are added to `nativeBuildInputs` unconditionally.
432 : Like `*SystemDepends`, but are added to `buildInputs` unconditionally.
435 : Like `*PkgconfigDepends`, but are added to `buildInputs` unconditionally.
438 : Deprecated, use either `testHaskellDepends` or `testSystemDepends`.
441 : Deprecated, use either `benchmarkHaskellDepends` or `benchmarkSystemDepends`.
443 The dependency specification methods in this list which are unconditional
444 are especially useful when writing [overrides](#haskell-overriding-haskell-packages)
445 when you want to make sure that they are definitely included. However, it is
446 recommended to use the more accurate ones listed above when possible.
448 ### Meta attributes {#haskell-derivation-meta}
450 `haskellPackages.mkDerivation` accepts the following attributes as direct
451 arguments which are transparently set in `meta` of the resulting derivation. See
452 the [Meta-attributes section](#chap-meta) for their documentation.
454 * These attributes are populated with a default value if omitted:
455 * `homepage`: defaults to the Hackage page for `pname`.
456 * `platforms`: defaults to `lib.platforms.all` (since GHC can cross-compile)
457 * These attributes are only set if given:
465 ### Incremental builds {#haskell-incremental-builds}
467 `haskellPackages.mkDerivation` supports incremental builds for GHC 9.4 and
468 newer with the `doInstallIntermediates`, `enableSeparateIntermediatesOutput`,
469 and `previousIntermediates` arguments.
471 The basic idea is to first perform a full build of the package in question,
472 save its intermediate build products for later, and then copy those build
473 products into the build directory of an incremental build performed later.
474 Then, GHC will use those build artifacts to avoid recompiling unchanged
477 For more detail on how to store and use incremental build products, see
478 [Gabriella Gonzalez’ blog post “Nixpkgs support for incremental Haskell
479 builds”.][incremental-builds] motivation behind this feature.
481 An incremental build for [the `turtle` package][turtle] can be performed like
486 pkgs = import <nixpkgs> {};
487 inherit (pkgs) haskell;
488 inherit (haskell.lib.compose) overrideCabal;
490 # Incremental builds work with GHC >=9.4.
491 turtle = haskell.packages.ghc944.turtle;
493 # This will do a full build of `turtle`, while writing the intermediate build products
494 # (compiled modules, etc.) to the `intermediates` output.
495 turtle-full-build-with-incremental-output = overrideCabal (drv: {
496 doInstallIntermediates = true;
497 enableSeparateIntermediatesOutput = true;
500 # This will do an incremental build of `turtle` by copying the previously
501 # compiled modules and intermediate build products into the source tree
502 # before running the build.
504 # GHC will then naturally pick up and reuse these products, making this build
505 # complete much more quickly than the previous one.
506 turtle-incremental-build = overrideCabal (drv: {
507 previousIntermediates = turtle-full-build-with-incremental-output.intermediates;
510 turtle-incremental-build
513 ## Development environments {#haskell-development-environments}
515 In addition to building and installing Haskell software, nixpkgs can also
516 provide development environments for Haskell projects. This has the obvious
517 advantage that you benefit from `cache.nixos.org` and no longer need to compile
518 all project dependencies yourself. While it is often very useful, this is not
519 the primary use case of our package set. Have a look at the section
520 [available package versions](#haskell-available-versions) to learn which
521 versions of packages we provide and the section
522 [limitations](#haskell-limitations), to judge whether a `haskellPackages`
523 based development environment for your project is feasible.
525 By default, every derivation built using
526 [`haskellPackages.mkDerivation`](#haskell-mkderivation) exposes an environment
527 suitable for building it interactively as the `env` attribute. For example, if
528 you have a local checkout of `random`, you can enter a development environment
529 for it like this (if the dependencies in the development and packaged version
534 $ nix-shell -A haskellPackages.random.env '<nixpkgs>'
535 [nix-shell:~/src/random]$ ghc-pkg list
536 /nix/store/a8hhl54xlzfizrhcf03c1l3f6l9l8qwv-ghc-9.2.4-with-packages/lib/ghc-9.2.4/package.conf.d
546 As you can see, the environment contains a GHC which is set up so it finds all
547 dependencies of `random`. Note that this environment does not mirror
548 the environment used to build the package, but is intended as a convenient
549 tool for development and simple debugging. `env` relies on the `ghcWithPackages`
550 wrapper which automatically injects a pre-populated package-db into every
551 GHC invocation. In contrast, using `nix-shell -A haskellPackages.random` will
552 not result in an environment in which the dependencies are in GHCs package
553 database. Instead, the Haskell builder will pass in all dependencies explicitly
556 `env` mirrors the normal derivation environment in one aspect: It does not include
557 familiar development tools like `cabal-install`, since we rely on plain `Setup.hs`
558 to build all packages. However, `cabal-install` will work as expected if in
559 `PATH` (e.g. when installed globally and using a `nix-shell` without `--pure`).
560 A declarative and pure way of adding arbitrary development tools is provided
561 via [`shellFor`](#haskell-shellFor).
563 When using `cabal-install` for dependency resolution you need to be a bit
564 careful to achieve build purity. `cabal-install` will find and use all
565 dependencies installed from the packages `env` via Nix, but it will also
566 consult Hackage to potentially download and compile dependencies if it can’t
567 find a valid build plan locally. To prevent this you can either never run
568 `cabal update`, remove the cabal database from your `~/.cabal` folder or run
569 `cabal` with `--offline`. Note though, that for some usecases `cabal2nix` needs
570 the local Hackage db.
572 Often you won't work on a package that is already part of `haskellPackages` or
573 Hackage, so we first need to write a Nix expression to obtain the development
574 environment from. Luckily, we can generate one very easily from an already
575 existing cabal file using `cabal2nix`:
579 my-project.cabal src …
580 $ cabal2nix ./. > my-project.nix
583 The generated Nix expression evaluates to a function ready to be
584 `callPackage`-ed. For now, we can add a minimal `default.nix` which does just
588 # Retrieve nixpkgs impurely from NIX_PATH for now, you can pin it instead, of course.
589 { pkgs ? import <nixpkgs> {} }:
591 # use the nixpkgs default haskell package set
592 pkgs.haskellPackages.callPackage ./my-project.nix { }
595 Using `nix-build default.nix` we can now build our project, but we can also
596 enter a shell with all the package's dependencies available using `nix-shell
597 -A env default.nix`. If you have `cabal-install` installed globally, it'll work
598 inside the shell as expected.
600 ### shellFor {#haskell-shellFor}
602 Having to install tools globally is obviously not great, especially if you want
603 to provide a batteries-included `shell.nix` with your project. Luckily there's a
604 proper tool for making development environments out of packages' build
605 environments: `shellFor`, a function exposed by every haskell package set. It
606 takes the following arguments and returns a derivation which is suitable as a
607 development environment inside `nix-shell`:
610 : This argument is used to select the packages for which to build the
611 development environment. This should be a function which takes a haskell package
612 set and returns a list of packages. `shellFor` will pass the used package set to
613 this function and include all dependencies of the returned package in the build
614 environment. This means you can reuse Nix expressions of packages included in
615 nixpkgs, but also use local Nix expressions like this: `hpkgs: [
616 (hpkgs.callPackage ./my-project.nix { }) ]`.
619 : Expects a list of derivations to add as build tools to the build environment.
620 This is the place to add packages like `cabal-install`, `doctest` or `hlint`.
624 : Expects a list of derivations to add as library dependencies, like `openssl`.
625 This is rarely necessary as the haskell package expressions usually track system
626 dependencies as well. Defaults to `[]`. (see also
627 [derivation dependencies](#haskell-derivation-deps))
630 : If this is true, `hoogle` will be added to `nativeBuildInputs`.
631 Additionally, its database will be populated with all included dependencies,
632 so you'll be able search through the documentation of your dependencies.
635 `genericBuilderArgsModifier`
636 : This argument accepts a function allowing you to modify the arguments passed
637 to `mkDerivation` in order to create the development environment. For example,
638 `args: { doCheck = false; }` would cause the environment to not include any test
639 dependencies. Defaults to `lib.id`.
642 : This is a shortcut for enabling `doBenchmark` via `genericBuilderArgsModifier`.
643 Setting it to `true` will cause the development environment to include all
644 benchmark dependencies which would be excluded by default. Defaults to `false`.
646 One neat property of `shellFor` is that it allows you to work on multiple
647 packages using the same environment in conjunction with
648 [cabal.project files][cabal-project-files].
649 Say our example above depends on `distribution-nixpkgs` and we have a project
650 file set up for both, we can add the following `shell.nix` expression:
653 { pkgs ? import <nixpkgs> {} }:
655 pkgs.haskellPackages.shellFor {
657 # reuse the nixpkgs for this package
658 hpkgs.distribution-nixpkgs
659 # call our generated Nix expression manually
660 (hpkgs.callPackage ./my-project/my-project.nix { })
663 # development tools we use
664 nativeBuildInputs = [
666 pkgs.haskellPackages.doctest
670 # Extra arguments are added to mkDerivation's arguments as-is.
671 # Since it adds all passed arguments to the shell environment,
672 # we can use this to set the environment variable the `Paths_`
673 # module of distribution-nixpkgs uses to search for bundled
675 # See also: https://cabal.readthedocs.io/en/latest/cabal-package.html#accessing-data-files-from-package-code
676 distribution_nixpkgs_datadir = toString ./distribution-nixpkgs;
680 <!-- TODO(@sternenseemann): deps are not included if not selected -->
682 ### haskell-language-server {#haskell-language-server}
684 To use HLS in short: Install `pkgs.haskell-language-server` e.g. in
685 `nativeBuildInputs` in `shellFor` and use the `haskell-language-server-wrapper`
686 command to run it. See the [HLS user guide] on how to configure your text
687 editor to use HLS and how to test your setup.
689 HLS needs to be compiled with the GHC version of the project you use it
692 ``pkgs.haskell-language-server`` provides
693 ``haskell-language-server-wrapper``, ``haskell-language-server``
694 and ``haskell-language-server-x.x.x``
695 binaries, where ``x.x.x`` is the GHC version for which it is compiled. By
696 default, it only includes binaries for the current GHC version, to reduce
697 closure size. The closure size is large, because HLS needs to be dynamically
698 linked to work reliably. You can override the list of supported GHC versions
702 pkgs.haskell-language-server.override { supportedGhcVersions = [ "90" "94" ]; }
704 Where all strings `version` are allowed such that
705 `haskell.packages.ghc${version}` is an existing package set.
707 When you run `haskell-language-server-wrapper` it will detect the GHC
708 version used by the project you are working on (by asking e.g. cabal or
709 stack) and pick the appropriate versioned binary from your path.
711 Be careful when installing HLS globally and using a pinned nixpkgs for a
712 Haskell project in a `nix-shell`. If the nixpkgs versions deviate to much
713 (e.g., use different `glibc` versions) the `haskell-language-server-?.?.?`
714 executable will try to detect these situations and refuse to start. It is
715 recommended to obtain HLS via `nix-shell` from the nixpkgs version pinned in
718 The top level `pkgs.haskell-language-server` attribute is just a convenience
719 wrapper to make it possible to install HLS for multiple GHC versions at the
720 same time. If you know, that you only use one GHC version, e.g., in a project
721 specific `nix-shell` you can use
722 `pkgs.haskellPackages.haskell-language-server` or
723 `pkgs.haskell.packages.*.haskell-language-server` from the package set you use.
725 If you use `nix-shell` for your development environments remember to start your
726 editor in that environment. You may want to use something like `direnv` and/or an
727 editor plugin to achieve this.
729 ## Overriding Haskell packages {#haskell-overriding-haskell-packages}
731 ### Overriding a single package {#haskell-overriding-a-single-package}
733 <!-- TODO(@sternenseemann): we should document /somewhere/ that base == null etc. -->
735 Like many language specific subsystems in nixpkgs, the Haskell infrastructure
736 also has its own quirks when it comes to overriding. Overriding of the *inputs*
737 to a package at least follows the standard procedure. For example, imagine you
738 need to build `nix-tree` with a more recent version of `brick` than the default
739 one provided by `haskellPackages`:
742 haskellPackages.nix-tree.override {
743 brick = haskellPackages.brick_0_67;
747 <!-- TODO(@sternenseemann): This belongs in the next section
748 One common problem you may run into with such an override is the build failing
749 with “abort because of serious configure-time warning from Cabal”. When scrolling
750 up, you'll usually notice that Cabal noticed that more than one versions of the same
751 package was present in the dependency graph. This typically causes a later compilation
752 failure (the error message `haskellPackages.mkDerivation` produces tries to save
753 you the time of finding this out yourself, but if you wish to do so, you can
754 disable it using `allowInconsistentDependencies`). Luckily, `haskellPackages` provides
755 you with a tool to deal with this. `overrideScope` creates a new `haskellPackages`
756 instance with the override applied *globally* for this package, so the dependency
757 closure automatically uses a consistent version of the overridden package. E. g.
758 if `haskell-ci` needs a recent version of `Cabal`, but also uses other packages
759 that depend on that library, you may want to use:
762 haskellPackages.haskell-ci.overrideScope (self: super: {
763 Cabal = self.Cabal_3_6_2_0;
769 The custom interface comes into play when you want to override the arguments
770 passed to `haskellPackages.mkDerivation`. For this, the function `overrideCabal`
771 from `haskell.lib.compose` is used. E.g., if you want to install a man page
772 that is distributed with the package, you can do something like this:
775 haskell.lib.compose.overrideCabal (drv: {
777 ${drv.postInstall or ""}
778 install -Dm644 man/pnbackup.1 -t $out/share/man/man1
780 }) haskellPackages.pnbackup
783 `overrideCabal` takes two arguments:
785 1. A function which receives all arguments passed to `haskellPackages.mkDerivation`
786 before and returns a set of arguments to replace (or add) with a new value.
787 2. The Haskell derivation to override.
789 The arguments are ordered so that you can easily create helper functions by making
794 installManPage = haskell.lib.compose.overrideCabal (drv: {
796 ${drv.postInstall or ""}
797 install -Dm644 man/${drv.pname}.1 -t "$out/share/man/man1"
802 installManPage haskellPackages.pnbackup
805 In fact, `haskell.lib.compose` already provides lots of useful helpers for common
806 tasks, detailed in the next section. They are also structured in such a way that
807 they can be combined using `lib.pipe`:
810 lib.pipe my-haskell-package [
811 # lift version bounds on dependencies
812 haskell.lib.compose.doJailbreak
813 # disable building the haddock documentation
814 haskell.lib.compose.dontHaddock
815 # pass extra package flag to Cabal's configure step
816 (haskell.lib.compose.enableCabalFlag "myflag")
820 #### `haskell.lib.compose` {#haskell-haskell.lib.compose}
822 The base interface for all overriding is the following function:
824 `overrideCabal f drv`
825 : Takes the arguments passed to obtain `drv` to `f` and uses the resulting
826 attribute set to update the argument set. Then a recomputed version of `drv`
827 using the new argument set is returned.
830 TODO(@sternenseemann): ideally we want to be more detailed here as well, but
831 I want to avoid the documentation having to be kept in sync in too many places.
832 We already document this stuff in the mkDerivation section and lib/compose.nix.
833 Ideally this section would be generated from the latter in the future.
836 All other helper functions are implemented in terms of `overrideCabal` and make
837 common overrides shorter and more complicate ones trivial. The simple overrides
838 which only change a single argument are only described very briefly in the
839 following overview. Refer to the
840 [documentation of `haskellPackages.mkDerivation`](#haskell-mkderivation)
841 for a more detailed description of the effects of the respective arguments.
843 ##### Packaging Helpers {#haskell-packaging-helpers}
845 `overrideSrc { src, version } drv`
846 : Replace the source used for building `drv` with the path or derivation given
847 as `src`. The `version` attribute is optional. Prefer this function over
848 overriding `src` via `overrideCabal`, since it also automatically takes care of
849 removing any Hackage revisions.
851 <!-- TODO(@sternenseemann): deprecated
853 `generateOptparseApplicativeCompletions list drv`
854 : Generate and install shell completion files for the installed executables whose
855 names are given via `list`. The executables need to be using `optparse-applicative`
859 `justStaticExecutables drv`
860 : Only build and install the executables produced by `drv`, removing everything
861 that may refer to other Haskell packages' store paths (like libraries and
862 documentation). This dramatically reduces the closure size of the resulting
863 derivation. Note that the executables are only statically linked against their
864 Haskell dependencies, but will still link dynamically against libc, GMP and
865 other system library dependencies.
867 If a library or its dependencies use their Cabal-generated
868 `Paths_*` module, this may not work as well if GHC's dead code elimination is
869 unable to remove the references to the dependency's store path that module
871 As a consequence, an unused reference may be created from the static binary to such a _library_ store path.
872 (See [nixpkgs#164630][164630] for more information.)
874 Importing the `Paths_*` module may cause builds to fail with this message:
877 error: output '/nix/store/64k8iw0ryz76qpijsnl9v87fb26v28z8-my-haskell-package-1.0.0.0' is not allowed to refer to the following paths:
878 /nix/store/5q5s4a07gaz50h04zpfbda8xjs8wrnhg-ghc-9.6.3
881 If that happens, first disable the check for GHC references and rebuild the
885 pkgs.haskell.lib.overrideCabal
886 (pkgs.haskell.lib.justStaticExecutables my-haskell-package)
888 disallowGhcReference = false;
892 Then use `strings` to determine which libraries are responsible:
896 $ strings result/bin/my-haskell-binary | grep /nix/store/
898 /nix/store/n7ciwdlg8yyxdhbrgd6yc2d8ypnwpmgq-hs-opentelemetry-sdk-0.0.3.6/bin
902 Finally, use `remove-references-to` to delete those store paths from the produced output:
905 pkgs.haskell.lib.overrideCabal
906 (pkgs.haskell.lib.justStaticExecutables my-haskell-package)
909 ${drv.postInstall or ""}
910 remove-references-to -t ${pkgs.haskellPackages.hs-opentelemetry-sdk}
915 [164630]: https://github.com/NixOS/nixpkgs/issues/164630
917 `enableSeparateBinOutput drv`
918 : Install executables produced by `drv` to a separate `bin` output. This
919 has a similar effect as `justStaticExecutables`, but preserves the libraries
920 and documentation in the `out` output alongside the `bin` output with a
921 much smaller closure size.
924 : Sets the `broken` flag to `true` for `drv`.
926 `markUnbroken drv`, `unmarkBroken drv`
927 : Set the `broken` flag to `false` for `drv`.
930 : Updates `hydraPlatforms` so that Hydra will build `drv`. This is
931 sometimes necessary when working with versioned packages in
932 `haskellPackages` which are not built by default.
935 : Sets `hydraPlatforms` to `[]`, causing Hydra to skip this package
936 altogether. Useful if it fails to evaluate cleanly and is causing
937 noise in the evaluation errors tab on Hydra.
939 ##### Development Helpers {#haskell-development-helpers}
942 : Create a source distribution tarball like those found on Hackage
943 instead of building the package `drv`.
945 `documentationTarball drv`
946 : Create a documentation tarball suitable for uploading to Hackage
947 instead of building the package `drv`.
950 : Uses `sdistTarball drv` as the source to compile `drv`. This helps to catch
951 packaging bugs when building from a local directory, e.g. when required files
952 are missing from `extra-source-files`.
954 `failOnAllWarnings drv`
955 : Enables all warnings GHC supports and makes it fail the build if any of them
958 <!-- TODO(@sternenseemann):
959 `checkUnusedPackages opts drv`
960 : Adds an extra check to `postBuild` which fails the build if any dependency
961 taken as an input is not used. The `opts` attribute set allows relaxing this
965 `enableDWARFDebugging drv`
966 : Compiles the package with additional debug symbols enabled, useful
967 for debugging with e.g. `gdb`.
970 : Sets `doStrip` to `true` for `drv`.
973 : Sets `doStrip` to `false` for `drv`.
975 <!-- TODO(@sternenseemann): shellAware -->
977 ##### Trivial Helpers {#haskell-trivial-helpers}
980 : Sets the `jailbreak` argument to `true` for `drv`.
983 : Sets the `jailbreak` argument to `false` for `drv`.
986 : Sets `doHaddock` to `true` for `drv`.
989 : Sets `doHaddock` to `false` for `drv`. Useful if the build of a package is
990 failing because of e.g. a syntax error in the Haddock documentation.
992 `doHyperlinkSource drv`
993 : Sets `hyperlinkSource` to `true` for `drv`.
995 `dontHyperlinkSource drv`
996 : Sets `hyperlinkSource` to `false` for `drv`.
999 : Sets `doCheck` to `true` for `drv`.
1002 : Sets `doCheck` to `false` for `drv`. Useful if a package has a broken,
1003 flaky or otherwise problematic test suite breaking the build.
1005 `dontCheckIf condition drv`
1006 : Sets `doCheck` to `false` for `drv`, but only if `condition` applies.
1007 Otherwise it's a no-op. Useful to conditionally disable tests for a package
1008 without interfering with previous overrides or default values.
1010 <!-- Purposefully omitting the non-list variants here. They are a bit
1011 ugly, and we may want to deprecate them at some point. -->
1013 `appendConfigureFlags list drv`
1014 : Adds the strings in `list` to the `configureFlags` argument for `drv`.
1016 `enableCabalFlag flag drv`
1017 : Makes sure that the Cabal flag `flag` is enabled in Cabal's configure step.
1019 `disableCabalFlag flag drv`
1020 : Makes sure that the Cabal flag `flag` is disabled in Cabal's configure step.
1022 `appendBuildFlags list drv`
1023 : Adds the strings in `list` to the `buildFlags` argument for `drv`.
1025 <!-- TODO(@sternenseemann): removeConfigureFlag -->
1027 `appendPatches list drv`
1028 : Adds the `list` of derivations or paths to the `patches` argument for `drv`.
1030 <!-- TODO(@sternenseemann): link dep section -->
1032 `addBuildTools list drv`
1033 : Adds the `list` of derivations to the `buildTools` argument for `drv`.
1035 `addExtraLibraries list drv`
1036 : Adds the `list` of derivations to the `extraLibraries` argument for `drv`.
1038 `addBuildDepends list drv`
1039 : Adds the `list` of derivations to the `buildDepends` argument for `drv`.
1041 `addTestToolDepends list drv`
1042 : Adds the `list` of derivations to the `testToolDepends` argument for `drv`.
1044 `addPkgconfigDepends list drv`
1045 : Adds the `list` of derivations to the `pkg-configDepends` argument for `drv`.
1047 `addSetupDepends list drv`
1048 : Adds the `list` of derivations to the `setupHaskellDepends` argument for `drv`.
1051 : Set `doBenchmark` to `true` for `drv`. Useful if your development
1052 environment is missing the dependencies necessary for compiling the
1053 benchmark component.
1056 : Set `doBenchmark` to `false` for `drv`.
1058 `setBuildTargets drv list`
1059 : Sets the `buildTarget` argument for `drv` so that the targets specified in `list` are built.
1062 : Sets the `doCoverage` argument to `true` for `drv`.
1065 : Sets the `doCoverage` argument to `false` for `drv`.
1067 `enableExecutableProfiling drv`
1068 : Sets the `enableExecutableProfiling` argument to `true` for `drv`.
1070 `disableExecutableProfiling drv`
1071 : Sets the `enableExecutableProfiling` argument to `false` for `drv`.
1073 `enableLibraryProfiling drv`
1074 : Sets the `enableLibraryProfiling` argument to `true` for `drv`.
1076 `disableLibraryProfiling drv`
1077 : Sets the `enableLibraryProfiling` argument to `false` for `drv`.
1079 #### Library functions in the Haskell package sets {#haskell-package-set-lib-functions}
1081 Some library functions depend on packages from the Haskell package sets. Thus they are
1082 exposed from those instead of from `haskell.lib.compose` which can only access what is
1083 passed directly to it. When using the functions below, make sure that you are obtaining them
1084 from the same package set (`haskellPackages`, `haskell.packages.ghc944` etc.) as the packages
1085 you are working with or – even better – from the `self`/`final` fix point of your overlay to
1088 Note: Some functions like `shellFor` that are not intended for overriding per se, are omitted
1089 in this section. <!-- TODO(@sternenseemann): note about ifd section -->
1091 `cabalSdist { src, name ? ... }`
1092 : Generates the Cabal sdist tarball for `src`, suitable for uploading to Hackage.
1093 Contrary to `haskell.lib.compose.sdistTarball`, it uses `cabal-install` over `Setup.hs`,
1094 so it is usually faster: No build dependencies need to be downloaded, and we can
1095 skip compiling `Setup.hs`.
1097 `buildFromCabalSdist drv`
1098 : Build `drv`, but run its `src` attribute through `cabalSdist` first. Useful for catching
1099 files necessary for compilation that are missing from the sdist.
1101 `generateOptparseApplicativeCompletions list drv`
1102 : Generate and install shell completion files for the installed executables whose
1103 names are given via `list`. The executables need to be using `optparse-applicative`
1104 for [this to work][optparse-applicative-completions].
1105 Note that this feature is automatically disabled when cross-compiling, since it
1106 requires executing the binaries in question.
1108 ## Import-from-Derivation helpers {#haskell-import-from-derivation}
1110 ### cabal2nix {#haskell-cabal2nix}
1112 [`cabal2nix`][cabal2nix] can generate Nix package definitions for arbitrary
1113 Haskell packages using [import from derivation][import-from-derivation].
1114 `cabal2nix` will generate Nix expressions that look like this:
1117 # cabal get mtl-2.2.1 && cd mtl-2.2.1 && cabal2nix .
1118 { mkDerivation, base, lib, transformers }:
1123 libraryHaskellDepends = [ base transformers ];
1124 homepage = "http://github.com/ekmett/mtl";
1125 description = "Monad classes, using functional dependencies";
1126 license = lib.licenses.bsd3;
1130 This expression should be called with `haskellPackages.callPackage`, which will
1131 supply [`haskellPackages.mkDerivation`](#haskell-mkderivation) and the Haskell
1132 dependencies as arguments.
1134 `callCabal2nix name src args`
1135 : Create a package named `name` from the source derivation `src` using
1138 `args` are extra arguments provided to `haskellPackages.callPackage`.
1140 `callCabal2nixWithOptions name src opts args`
1141 : Create a package named `name` from the source derivation `src` using
1144 `opts` are extra options for calling `cabal2nix`. If `opts` is a string, it
1145 will be used as extra command line arguments for `cabal2nix`, e.g. `--subpath
1146 path/to/dir/containing/cabal-file`. Otherwise, `opts` should be an AttrSet
1147 which can contain the following attributes:
1149 `extraCabal2nixOptions`
1150 : Extra command line arguments for `cabal2nix`.
1153 : A function which is used to modify the given `src` instead of the default
1156 The default source filter will remove all files from `src` except for
1157 `.cabal` files and `package.yaml` files.
1174 TODO(@NixOS/haskell): finish these planned sections
1175 ### Overriding the entire package set
1177 ## Contributing {#haskell-contributing}
1179 ### Fixing a broken package {#haskell-fixing-a-broken-package}
1181 ### Package set generation {#haskell-package-set-generation}
1183 ### Packaging a Haskell project
1185 ### Backporting {#haskell-backporting}
1187 Backporting changes to a stable NixOS version in general is covered
1188 in nixpkgs' `CONTRIBUTING.md` in general. In particular refer to the
1189 [backporting policy](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#criteria-for-backporting-changes)
1190 to check if the change you have in mind may be backported.
1192 This section focuses on how to backport a package update (e.g. a
1193 bug fix or security release). Fixing a broken package works like
1194 it does for the unstable branches.
1198 ## F.A.Q. {#haskell-faq}
1200 ### Why is topic X not covered in this section? Why is section Y missing? {#haskell-why-not-covered}
1202 We have been working on [moving the nixpkgs Haskell documentation back into the
1203 nixpkgs manual](https://github.com/NixOS/nixpkgs/issues/121403). Since this
1204 process has not been completed yet, you may find some topics missing here
1205 covered in the old [haskell4nix docs](https://haskell4nix.readthedocs.io/).
1207 If you feel any important topic is not documented at all, feel free to comment
1208 on the issue linked above.
1210 ### How to enable or disable profiling builds globally? {#haskell-faq-override-profiling}
1212 By default, Nixpkgs builds a profiling version of each Haskell library. The
1213 exception to this rule are some platforms where it is disabled due to concerns
1214 over output size. You may want to…
1216 * …enable profiling globally so that you can build a project you are working on
1217 with profiling ability giving you insight in the time spent across your code
1218 and code you depend on using [GHC's profiling feature][profiling].
1220 * …disable profiling (globally) to reduce the time spent building the profiling
1221 versions of libraries which a significant amount of build time is spent on
1222 (although they are not as expensive as the “normal” build of a Haskell library).
1225 The method described below affects the build of all libraries in the
1226 respective Haskell package set as well as GHC. If your choices differ from
1227 Nixpkgs' default for your (host) platform, you will lose the ability to
1228 substitute from the official binary cache.
1230 If you are concerned about build times and thus want to disable profiling, it
1231 probably makes sense to use `haskell.lib.compose.disableLibraryProfiling` (see
1232 [](#haskell-trivial-helpers)) on the packages you are building locally while
1233 continuing to substitute their dependencies and GHC.
1236 Since we need to change the profiling settings for the desired Haskell package
1237 set _and_ GHC (as the core libraries like `base`, `filepath` etc. are bundled
1238 with GHC), it is recommended to use overlays for Nixpkgs to change them.
1239 Since the interrelated parts, i.e. the package set and GHC, are connected
1240 via the Nixpkgs fixpoint, we need to modify them both in a way that preserves
1241 their connection (or else we'd have to wire it up again manually). This is
1242 achieved by changing GHC and the package set in separate overlays to prevent
1243 the package set from pulling in GHC from `prev`.
1245 The result is two overlays like the ones shown below. Adjustable parts are
1246 annotated with comments, as are any optional or alternative ways to achieve
1247 the desired profiling settings without causing too many rebuilds.
1249 <!-- TODO(@sternenseemann): buildHaskellPackages != haskellPackages with this overlay,
1250 affected by https://github.com/NixOS/nixpkgs/issues/235960 which needs to be fixed
1256 # Name of the compiler and package set you want to change. If you are using
1257 # the default package set `haskellPackages`, you need to look up what version
1258 # of GHC it currently uses (note that this is subject to change).
1260 # Desired new setting
1261 enableProfiling = true;
1265 # The first overlay modifies the GHC derivation so that it does or does not
1266 # build profiling versions of the core libraries bundled with it. It is
1267 # recommended to only use such an overlay if you are enabling profiling on a
1268 # platform that doesn't by default, because compiling GHC from scratch is
1272 inherit (final) lib;
1276 haskell = prev.haskell // {
1277 compiler = prev.haskell.compiler // {
1278 ${ghcName} = prev.haskell.compiler.${ghcName}.override {
1279 # Unfortunately, the GHC setting is named differently for historical reasons
1280 enableProfiledLibs = enableProfiling;
1288 inherit (final) lib;
1289 haskellLib = final.haskell.lib.compose;
1293 haskell = prev.haskell // {
1294 packages = prev.haskell.packages // {
1295 ${ghcName} = prev.haskell.packages.${ghcName}.override {
1296 overrides = hfinal: hprev: {
1297 mkDerivation = args: hprev.mkDerivation (args // {
1298 # Since we are forcing our ideas upon mkDerivation, this change will
1299 # affect every package in the package set.
1300 enableLibraryProfiling = enableProfiling;
1302 # To actually use profiling on an executable, executable profiling
1303 # needs to be enabled for the executable you want to profile. You
1304 # can either do this globally or…
1305 enableExecutableProfiling = enableProfiling;
1308 # …only for the package that contains an executable you want to profile.
1309 # That saves on unnecessary rebuilds for packages that you only depend
1310 # on for their library, but also contain executables (e.g. pandoc).
1311 my-executable = haskellLib.enableExecutableProfiling hprev.my-executable;
1313 # If you are disabling profiling to save on build time, but want to
1314 # retain the ability to substitute from the binary cache. Drop the
1315 # override for mkDerivation above and instead have an override like
1316 # this for the specific packages you are building locally and want
1317 # to make cheaper to build.
1318 my-library = haskellLib.disableLibraryProfiling hprev.my-library;
1327 <!-- TODO(@sternenseemann): write overriding mkDerivation, overriding GHC, and
1328 overriding the entire package set sections and link to them from here where
1332 [Stackage]: https://www.stackage.org
1333 [cabal-project-files]: https://cabal.readthedocs.io/en/latest/cabal-project.html
1334 [cabal2nix]: https://github.com/nixos/cabal2nix
1335 [cpphs]: https://Hackage.haskell.org/package/cpphs
1336 [haddock-hoogle-option]: https://haskell-haddock.readthedocs.io/en/latest/invoking.html#cmdoption-hoogle
1337 [haddock-hyperlinked-source-option]: https://haskell-haddock.readthedocs.io/en/latest/invoking.html#cmdoption-hyperlinked-source
1338 [haddock]: https://www.haskell.org/haddock/
1339 [haskell-program-coverage]: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/profiling.html#observing-code-coverage
1340 [haskell.nix]: https://input-output-hk.github.io/haskell.nix/index.html
1341 [HLS user guide]: https://haskell-language-server.readthedocs.io/en/latest/configuration.html#configuring-your-editor
1342 [hoogle]: https://wiki.haskell.org/Hoogle
1343 [incremental-builds]: https://www.haskellforall.com/2022/12/nixpkgs-support-for-incremental-haskell.html
1344 [jailbreak-cabal]: https://github.com/NixOS/jailbreak-cabal/
1345 [multiple-outputs]: https://nixos.org/manual/nixpkgs/stable/#chap-multiple-output
1346 [optparse-applicative-completions]: https://github.com/pcapriotti/optparse-applicative/blob/7726b63796aa5d0df82e926d467f039b78ca09e2/README.md#bash-zsh-and-fish-completions
1347 [profiling-detail]: https://cabal.readthedocs.io/en/latest/cabal-project.html#cfg-field-profiling-detail
1348 [profiling]: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/profiling.html
1349 [search.nixos.org]: https://search.nixos.org
1350 [turtle]: https://hackage.haskell.org/package/turtle
1351 [import-from-derivation]: https://nixos.org/manual/nix/stable/language/import-from-derivation