Changeset 39528 in project


Ignore:
Timestamp:
01/25/21 04:38:26 (5 months ago)
Author:
evhan
Message:

wiki/beaker: Update Nix helper docs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/beaker

    r39517 r39528  
    7171 $ chicken-lock r7rs > r7rs.lock
    7272 ... time passes...
    73  $ chicken-install -override r7rs.lock r7rs
     73 $ chicken-install -from-list r7rs.lock
    7474
    7575If no egg names are given on the command line, this program will look for
     
    198198== Nix Helpers
    199199
     200This project also includes some helper functions for the [[https://nixos.org/|Nix]]
     201package manager that make it easy to build CHICKEN programs.
     202
    200203=== Usage
    201204
    202 This library's Nix helpers can be imported from the Git repository archive:
     205The helpers can be imported directly from the Git repository archive:
    203206
    204207 let
    205208   beaker = import (fetchTarball https://git.sr.ht/~evhan/beaker/archive/master.tar.gz) {};
    206209 in
    207    doStuff { ... }
    208 
    209 The project's {{default.nix}} only includes two helpers so it's also relatively
    210 harmless to pull into scope, for example:
    211 
    212  with import (fetchTarball https://git.sr.ht/~evhan/beaker/archive/6bfb584b.tar.gz) {};
     210   doStuff { with beaker; ... }
     211
     212This library only includes two attributes, so it's also relatively harmless to
     213pull into scope, for example:
     214
     215 with import (fetchTarball https://git.sr.ht/~evhan/beaker/archive/3679375a.tar.gz) {};
    213216 
    214217 eggProgram {
     
    216219   src = ./.;
    217220   eggCache = eggCache {
    218      overrideFile = ./example.egg.lock;
     221     eggs = ./example.egg.lock;
    219222     hash = "sha256:00x5k7rhs1fy7fj5kma1yp2ikzbq98bfm33si5y8z8m25chb45sg";
    220223   };
     
    227230A fixed-output derivation that fetches a set of eggs for installation.
    228231
    229 The list of eggs to cache should be specified via {{overrideFile}}, which
    230 expects a path to a file in "override" specifying a list of egg names and
    231 versions. This file can be generated via {{chicken-status -list}} (for installed
    232 eggs) or {{chicken-lock}} (for a specific egg's dependencies).
     232The list of eggs to cache should be specified via {{eggs}}, which expects a path
     233to a file in "override" specifying a list of egg names and versions. This file
     234can be generated via {{chicken-status -list}} (for installed eggs) or
     235{{chicken-lock}} (for a specific egg's dependencies).
    233236
    234237 eggCache {
    235    name = "example-egg-cache"
    236    overrideFile = ./eggs.lock
    237    hash = "sha256:03pz5927dkazrf8hf53w03r80ca98fwp09gmd8iiywxc5vl8ll2m"
    238  }
     238   name = "example-egg-cache";
     239   hash = "sha256:03pz5927dkazrf8hf53w03r80ca98fwp09gmd8iiywxc5vl8ll2m";
     240   eggs = ./eggs.lock;
     241 }
     242
     243Alternatively, you can specify the list of eggs directly:
     244
     245 eggCache {
     246   name = "example-egg-cache";
     247   hash = "sha256:01fq1398aj4r54yw6ym8i56i236yb3pvmn6a54iahz09cp615g2x";
     248   eggs = [
     249     { name = "srfi-18"; version = "0.1"; }
     250     { name = "srfi-69"; version = "0.4"; }
     251   ];
     252 }
     253
     254==== Combining Multiple Egg Caches
     255
     256To merge multiple egg caches, you can use {{symlinkJoin}}:
     257
     258 pkgs.symlinkJoin {
     259   name = "example-egg-caches";
     260   paths = [
     261     (eggCache { ... })
     262     (eggCache { ... })
     263   ];
     264 }
     265
     266The result will be a single egg cache containing all of the specified eggs.
     267Note that if any input paths contain different versions of the same egg, the
     268first one listed takes precedence.
    239269
    240270=== Building Eggs
Note: See TracChangeset for help on using the changeset viewer.