From ea6ee1e2196516775a41adc6d698fe4f83e5cbb2 Mon Sep 17 00:00:00 2001 From: sterni Date: Thu, 26 Aug 2021 12:34:47 +0200 Subject: docs(nix/buildLisp): move example further up Make "Example" the second section again since it got a bit buried under a lot of detailed documentation you won't necessarily need right away. Change-Id: I481354d1761c590e5872dfce8c3cf9934e278673 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3421 Reviewed-by: tazjin Tested-by: BuildkiteCI --- nix/buildLisp/README.md | 58 ++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'nix/buildLisp') diff --git a/nix/buildLisp/README.md b/nix/buildLisp/README.md index 76fe5ca9e4..02435595ff 100644 --- a/nix/buildLisp/README.md +++ b/nix/buildLisp/README.md @@ -88,6 +88,35 @@ the `expression` parameter should be a Lisp expression and will be evaluated after loading all sources and dependencies (including library/program dependencies). It must return a non-`NIL` value if the test suite has passed. +## Example + +Using buildLisp could look like this: + +```nix +{ buildLisp, lispPkgs }: + +let libExample = buildLisp.library { + name = "lib-example"; + srcs = [ ./lib.lisp ]; + + deps = with lispPkgs; [ + (buildLisp.bundled "sb-posix") + iterate + cl-ppcre + ]; +}; +in buildLisp.program { + name = "example"; + deps = [ libExample ]; + srcs = [ ./main.lisp ]; + tests = { + deps = [ lispPkgs.fiveam ]; + srcs = [ ./tests.lisp ]; + expression = "(fiveam:run!)"; + }; +} +``` + ## Development REPLs `buildLisp` builds loadable variants of both `program` and `library` derivations @@ -195,35 +224,6 @@ This only influences `meta.targets` which is read by depot's CI to check which variants (see "Implementations") of the derivation to build, so it may not be useful outside of depot. -## Example - -Using buildLisp could look like this: - -```nix -{ buildLisp, lispPkgs }: - -let libExample = buildLisp.library { - name = "lib-example"; - srcs = [ ./lib.lisp ]; - - deps = with lispPkgs; [ - (buildLisp.bundled "sb-posix") - iterate - cl-ppcre - ]; -}; -in buildLisp.program { - name = "example"; - deps = [ libExample ]; - srcs = [ ./main.lisp ]; - tests = { - deps = [ lispPkgs.fiveam ]; - srcs = [ ./tests.lisp ]; - expression = "(fiveam:run!)"; - }; -} -``` - [sbcl]: http://www.sbcl.org/ [ccl]: https://ccl.clozure.com/ [ecl]: https://common-lisp.net/project/ecl/ -- cgit 1.4.1