diff options
Diffstat (limited to 'nixpkgs/doc/languages-frameworks/chicken.section.md')
-rw-r--r-- | nixpkgs/doc/languages-frameworks/chicken.section.md | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/nixpkgs/doc/languages-frameworks/chicken.section.md b/nixpkgs/doc/languages-frameworks/chicken.section.md index d329943dc3c2..72c2642a6478 100644 --- a/nixpkgs/doc/languages-frameworks/chicken.section.md +++ b/nixpkgs/doc/languages-frameworks/chicken.section.md @@ -47,3 +47,32 @@ To include more eggs, edit `pkgs/development/compilers/chicken/5/eggs.scm`. The first section of this file lists eggs which are required by `egg2nix` itself; all other eggs go into the second section. After editing, follow the procedure for updating eggs. + +## Override Scope {#sec-chicken-override-scope} + +The chicken package and its eggs, respectively, reside in a scope. This means, +the scope can be overridden to effect other packages in it. + +This example shows how to use a local copy of `srfi-180` and have it affect +all the other eggs: + +```nix +let + myChickenPackages = pkgs.chickenPackages.overrideScope' (self: super: { + # The chicken package itself can be overridden to effect the whole ecosystem. + # chicken = super.chicken.overrideAttrs { + # src = ... + # }; + + chickenEggs = super.chickenEggs.overrideScope' (eggself: eggsuper: { + srfi-180 = eggsuper.srfi-180.overrideAttrs { + # path to a local copy of srfi-180 + src = ... + }; + }); + }); +in +# Here, `myChickenPackages.chickenEggs.json-rpc`, which depends on `srfi-180` will use +# the local copy of `srfi-180`. +# ... +``` |