Changeset 39528 in project
- Timestamp:
- 01/25/21 04:38:26 (5 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wiki/eggref/5/beaker
r39517 r39528 71 71 $ chicken-lock r7rs > r7rs.lock 72 72 ... time passes... 73 $ chicken-install - override r7rs.lock r7rs73 $ chicken-install -from-list r7rs.lock 74 74 75 75 If no egg names are given on the command line, this program will look for … … 198 198 == Nix Helpers 199 199 200 This project also includes some helper functions for the [[https://nixos.org/|Nix]] 201 package manager that make it easy to build CHICKEN programs. 202 200 203 === Usage 201 204 202 Th is library's Nix helpers can be importedfrom the Git repository archive:205 The helpers can be imported directly from the Git repository archive: 203 206 204 207 let 205 208 beaker = import (fetchTarball https://git.sr.ht/~evhan/beaker/archive/master.tar.gz) {}; 206 209 in 207 doStuff { ... }208 209 Th e project's {{default.nix}} only includes two helpers so it's also relatively210 harmless topull into scope, for example:211 212 with import (fetchTarball https://git.sr.ht/~evhan/beaker/archive/ 6bfb584b.tar.gz) {};210 doStuff { with beaker; ... } 211 212 This library only includes two attributes, so it's also relatively harmless to 213 pull into scope, for example: 214 215 with import (fetchTarball https://git.sr.ht/~evhan/beaker/archive/3679375a.tar.gz) {}; 213 216 214 217 eggProgram { … … 216 219 src = ./.; 217 220 eggCache = eggCache { 218 overrideFile= ./example.egg.lock;221 eggs = ./example.egg.lock; 219 222 hash = "sha256:00x5k7rhs1fy7fj5kma1yp2ikzbq98bfm33si5y8z8m25chb45sg"; 220 223 }; … … 227 230 A fixed-output derivation that fetches a set of eggs for installation. 228 231 229 The list of eggs to cache should be specified via {{ overrideFile}}, which230 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).232 The list of eggs to cache should be specified via {{eggs}}, which expects a path 233 to a file in "override" specifying a list of egg names and versions. This file 234 can be generated via {{chicken-status -list}} (for installed eggs) or 235 {{chicken-lock}} (for a specific egg's dependencies). 233 236 234 237 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 243 Alternatively, 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 256 To 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 266 The result will be a single egg cache containing all of the specified eggs. 267 Note that if any input paths contain different versions of the same egg, the 268 first one listed takes precedence. 239 269 240 270 === Building Eggs
Note: See TracChangeset
for help on using the changeset viewer.