about summary refs log tree commit diff
path: root/nix/buildLisp
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-01-26T23·58+0000
committerVincent Ambo <tazjin@google.com>2020-01-26T23·58+0000
commitca60eafa808e2423fd64996b4f678b08ed3277a5 (patch)
tree4585d4925a0c328ea31911d4e38ce6a3057bc787 /nix/buildLisp
parent479510005b6f37237a56d4775670deb75de573bd (diff)
feat(nix/buildLisp): Add 'bundled' function for built-in libraries r/461
Makes it possible to add virtual dependencies on built-in libraries,
e.g. `buildLisp.bundled "sb-posix"`.
Diffstat (limited to 'nix/buildLisp')
-rw-r--r--nix/buildLisp/default.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/nix/buildLisp/default.nix b/nix/buildLisp/default.nix
index 6df1522748..58ba492a01 100644
--- a/nix/buildLisp/default.nix
+++ b/nix/buildLisp/default.nix
@@ -161,6 +161,13 @@ let
     lispBinary = true;
   };
 
+  # 'bundled' creates a "library" that calls 'require' on a built-in
+  # package, such as any of SBCL's sb-* packages.
+  bundled = name: (makeOverridable library) {
+    inherit name;
+    srcs = lib.singleton (builtins.toFile "${name}.lisp" "(require '${name})");
+  };
+
   # 'sbclWith' creates an image with the specified libraries /
   # programs loaded.
   sbclWith = deps:
@@ -173,4 +180,5 @@ in {
   library = makeOverridable library;
   program = makeOverridable program;
   sbclWith = makeOverridable sbclWith;
+  bundled = makeOverridable bundled;
 }