1 # CHICKEN {#sec-chicken}
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".
7 ## Using Eggs {#sec-chicken-using}
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
19 chickenPackages.chickenEggs.srfi-189
24 Both `chicken` and its eggs have a setup hook which configures the environment
25 variables `CHICKEN_INCLUDE_PATH` and `CHICKEN_REPOSITORY_PATH`.
27 ## Updating Eggs {#sec-chicken-updating-eggs}
29 nixpkgs only knows about a subset of all published eggs. It uses
30 [egg2nix](https://github.com/the-kenny/egg2nix) to generate a
31 package set from a list of eggs to include.
33 The package set is regenerated by running the following shell commands:
36 $ nix-shell -p chickenPackages.egg2nix
37 $ cd pkgs/development/compilers/chicken/5/
38 $ egg2nix eggs.scm > eggs.nix
41 ## Adding Eggs {#sec-chicken-adding-eggs}
43 When we run `egg2nix`, we obtain one collection of eggs with
44 mutually-compatible versions. This means that when we add new eggs, we may
45 need to update existing eggs. To keep those separate, follow the procedure for
46 updating eggs before including more eggs.
48 To include more eggs, edit `pkgs/development/compilers/chicken/5/eggs.scm`.
49 The first section of this file lists eggs which are required by `egg2nix`
50 itself; all other eggs go into the second section. After editing, follow the
51 procedure for updating eggs.
53 ## Override Scope {#sec-chicken-override-scope}
55 The chicken package and its eggs, respectively, reside in a scope. This means,
56 the scope can be overridden to effect other packages in it.
58 This example shows how to use a local copy of `srfi-180` and have it affect
63 myChickenPackages = pkgs.chickenPackages.overrideScope' (self: super: {
64 # The chicken package itself can be overridden to effect the whole ecosystem.
65 # chicken = super.chicken.overrideAttrs {
69 chickenEggs = super.chickenEggs.overrideScope' (eggself: eggsuper: {
70 srfi-180 = eggsuper.srfi-180.overrideAttrs {
71 # path to a local copy of srfi-180
77 # Here, `myChickenPackages.chickenEggs.json-rpc`, which depends on `srfi-180` will use
78 # the local copy of `srfi-180`.