···1+# CHICKEN {#sec-chicken}
2+3+[CHICKEN](https://call-cc.org/) is a
4+[R⁵RS](https://schemers.org/Documents/Standards/R5RS/HTML/)-compliant Scheme
5+compiler. It includes an interactive mode and a custom package format, "eggs".
6+7+## Using Eggs
8+9+Eggs described in nixpkgs are available inside the
10+`chickenPackages.chickenEggs` attrset. Including an egg as a build input is
11+done in the typical Nix fashion. For example, to include support for [SRFI
12+189](https://srfi.schemers.org/srfi-189/srfi-189.html) in a derivation, one
13+might write:
14+15+```nix
16+ buildInputs = [
17+ chicken
18+ chickenPackages.chickenEggs.srfi-189
19+ ];
20+```
21+22+Both `chicken` and its eggs have a setup hook which configures the environment
23+variables `CHICKEN_INCLUDE_PATH` and `CHICKEN_REPOSITORY_PATH`.
24+25+## Updating Eggs
26+27+nixpkgs only knows about a subset of all published eggs. It uses
28+[egg2nix](https://github.com/the-kenny/egg2nix) to generate a
29+package set from a list of eggs to include.
30+31+The package set is regenerated by running the following shell commands:
32+33+```
34+$ nix-shell -p chickenPackages.egg2nix
35+$ cd pkgs/development/compilers/chicken/5/
36+$ egg2nix eggs.scm > eggs.nix
37+```
38+39+## Adding Eggs
40+41+When we run `egg2nix`, we obtain one collection of eggs with
42+mutually-compatible versions. This means that when we add new eggs, we may
43+need to update existing eggs. To keep those separate, follow the procedure for
44+updating eggs before including more eggs.
45+46+To include more eggs, edit `pkgs/development/compilers/chicken/5/eggs.scm`.
47+The first section of this file lists eggs which are required by `egg2nix`
48+itself; all other eggs go into the second section. After editing, follow the
49+procedure for updating eggs.