This page documents the Nix API of nix-cl.
NOTE: This documentation is still work-in-progress.
The core API is:
buildASDFSystem
withPackages
overrideLispAttrs
The library flake exposes its supported lisp implementations as packages which have the above functions as attributes:
abcl
ccl
clasp
clisp
ecl
sbcl
You can also create new lisps by overriding
the spec of any of the provided lisps.
Packages are declared using buildASDFSystem
. This function takes
the following arguments and returns a Lisp package derivation.
sbcl.buildASDFSystem {
pname = "alexandria";
version = "v1.4";
src = pkgs.fetchFromGitLab {
domain = "gitlab.common-lisp.net";
owner = "alexandria";
repo = "alexandria";
rev = "v1.4";
hash = "sha256-1Hzxt65dZvgOFIljjjlSGgKYkj+YBLwJCACi5DZsKmQ=";
};
}
Name of the package/library
Version of the package/library
Source of the package/library (fetchTarball
, fetchGit
, fetchMercurial
etc.)
Patches to apply to the source code before compiling it. This is a list of files.
Native libraries, will be appended to the library
path. (pkgs.openssl
etc.)
Java libraries for ABCL, will be appended to the class path.
Lisp dependencies These must themselves be packages built with
buildASDFSystem
Some libraries have multiple systems under one project, for example,
cffi has cffi-grovel
, cffi-toolchain
etc. By default, only the
pname
system is build.
.asd's
not listed in systems
are removed before saving the library
to the Nix store. This prevents ASDF from referring to uncompiled
systems on run time.
Also useful when the pname
is differrent than the system name, such
as when using reverse domain naming. (see jzon
->
com.inuoe.jzon
)
The .asd files that this package provides. By default, same as
systems
.
A derivation
that, when built, contains the sources and pre-compiled
FASL files (Lisp implementation dependent) alongside any other
artifacts generated during compilation.
sbcl.withPackages (ps: [ ps.alexandria ])
A function of one argument that takes an attribute set and returns a list;
A lisp derivation that knows how to load some packages with asdf:load-system
.
Path to ASDF itself is put in the ASDF
environment variable. Thus, to load the
ASDF version provided by the library:
;; SBCL Example
(load (sb-ext:posix-getenv "ASDF"))
sbcl.pkgs.alexandria.overrideLispAttrs (oa: {
src = pkgs.fetchzip {
url = "https://example.org";
hash = "";
};
})
A function of one argument that takes an attribute set and returns an attribute set.
A lisp derivation that was build using the provided, different arguments.
sbcl.override {
packageOverlays = self: super: {
alexandria = pkgs.hello;
};
}
A function of two arguments, the new package set and the old one. It should return the new package set that should we woven into the old one.
New lisp with all occurrences of overlayed packages replaced with the new value;
sbcl.override {
spec = {
pkg = sbcl;
flags = "--dynamic-space-size 4096";
asdf = pkgs.hello;
};
}
Spec can contain the following attributes:
- pkg (required)
- asdf (required)
- program
- flags
New lisp infrastructure that works with the provided lisp implementation and uses the provided ASDF version.