1# Developer Architecture Overview
3This shall give a sufficiently good overview over the haskell.nix
4ideas, such that a new developer can navigate around without too
9`haskell.nix` is centered around packages (haskell package
10descriptions as nix-expressions). These are generated by
11`cabal-to-nix` from the `nix-tools` package. `stack-to-nix` and
12`plan-to-nix` will delegate the transformation of cabal packages to
13nix expressions to the same code that `cabal-to-nix` uses.
15These packages will look similar to the following:
18{ system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, ... }:
23 "library" = { depends = [ ... ]; };
24 exes = { "..." = { depends = [ ... ]; }; ... };
25 sublibs = { "..." = { depends = [ ... ]; }; ... };
26 tests = { "..." = { depends = [ ... ]; }; ... };
27 benchmarks = { "..." = { depends = [ ... ]; }; ... };
32The exact specification can be found in `modules/package.nix`.
36Packages (unless specified directly in the `packages` attribute of the
37module) usually come from a plan. A plan is either a Stackage snapshot
38(nightly or LTS) or a build plan as produced by `cabal`.
40Plan files usually look like the following:
45 "$pkg".revision = hackage.$pkg.$version.revisions.default;
46 "$pkg".flags = { flag1 = true; flag2 = false; ... };
60This provides enough information about the compiler, what packages the
61compiler ships with and the packages we want to use in our plan.
63This revision and flag information will be inlined into a list of
64packages in `config.packages` in `modules/plan.nix`. Thus
65`config.packages` will only contains packages as described in the
68## Package Sets (of derivations)
70We finally tie this all together in `package-set.nix` where we use
71`modules/component-driver.nix` to produce the derivations for each
72packages component to produce the final `config.hsPkgs` value.
74There is also a `modules/compat-driver.nix` that should produce the
75same packageset to be used with the stock haskell infrastructure in
76nixpkgs (*This has undergone substantially less testing*).
80To prevent depending on mutliple instances of the same libraries, the
81component builder will try to build every package from scratch and
82rely as little as possible on packages that are shipped with the GHC
83distribution. The exceptions are packages that are known to not be
84reinstallable. See `config.nonReinstallablePkgs`.
86The component builder can be found in `modules/component-driver.nix`
87and `builder/default.nix`. The component-driver will ensure that we do
88not try to rebuild non-reinstallable packages, and call the
89`builder/default.nix` on each package in `config.packages` to produce
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