From ca60eafa808e2423fd64996b4f678b08ed3277a5 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 26 Jan 2020 23:58:31 +0000 Subject: feat(nix/buildLisp): Add 'bundled' function for built-in libraries Makes it possible to add virtual dependencies on built-in libraries, e.g. `buildLisp.bundled "sb-posix"`. --- nix/buildLisp/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nix/buildLisp/default.nix b/nix/buildLisp/default.nix index 6df1522748c9..58ba492a0120 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; } -- cgit 1.4.1