1 {lib, stdenv, clwrapper, pkgs, sbcl, coreutils, nix, asdf}:
2 let lispPackages = rec {
3 inherit lib pkgs clwrapper stdenv;
5 callPackage = nixLib.callPackageWith lispPackages;
7 buildLispPackage = callPackage ./define-package.nix;
9 quicklisp = buildLispPackage rec {
10 baseName = "quicklisp";
11 version = "2021-02-13";
15 description = "The Common Lisp package manager";
17 src = pkgs.fetchFromGitHub {
19 repo = "quicklisp-client";
20 rev = "version-${version}";
21 sha256 = "sha256-1HLVPhl8aBaeG8dRLxBh0j0X/0wqFeNYK1CEfiELToA=";
25 quicklispdist = pkgs.fetchurl {
26 # Will usually be replaced with a fresh version anyway, but needs to be
27 # a valid distinfo.txt
28 url = "http://beta.quicklisp.org/dist/quicklisp/2021-12-09/distinfo.txt";
29 sha256 = "sha256:0gc4cv73nl7xkfwvmkmfhfx6yqf876nfm2v24v6fky9n24sh4y6w";
31 buildPhase = "true; ";
33 substituteAll ${./quicklisp.sh} "$out"/bin/quicklisp
34 chmod a+x "$out"/bin/quicklisp
35 cp "${quicklispdist}" "$out/lib/common-lisp/quicklisp/quicklisp-distinfo.txt"
40 quicklisp-to-nix-system-info = stdenv.mkDerivation {
41 pname = "quicklisp-to-nix-system-info";
43 src = ./quicklisp-to-nix;
44 nativeBuildInputs = [sbcl];
46 lispPackages.quicklisp coreutils
49 nix-prefetch-url = nix;
52 ${sbcl}/bin/sbcl --eval '(load #P"${asdf}/lib/common-lisp/asdf/build/asdf.lisp")' --load $src/system-info.lisp --eval '(ql-to-nix-system-info::dump-image)'
56 cp quicklisp-to-nix-system-info $out/bin
61 quicklisp-to-nix = stdenv.mkDerivation {
62 pname = "quicklisp-to-nix";
64 src = ./quicklisp-to-nix;
65 buildDependencies = [sbcl quicklisp-to-nix-system-info];
66 buildInputs = with pkgs.lispPackages; [md5 cl-emb alexandria external-program];
68 nix-prefetch-url = nix;
71 system-info = quicklisp-to-nix-system-info;
73 ${clwrapper}/bin/cl-wrapper.sh "${sbcl}/bin/sbcl" --eval '(load #P"${asdf}/lib/common-lisp/asdf/build/asdf.lisp")' --load $src/ql-to-nix.lisp --eval '(ql-to-nix::dump-image)'
77 cp quicklisp-to-nix $out/bin
82 clx-truetype = buildLispPackage rec {
83 baseName = "clx-truetype";
84 version = "20160825-git";
86 buildSystems = [ "clx-truetype" ];
87 parasites = [ "clx-truetype-test" ];
89 description = "clx-truetype is pure common lisp solution for antialiased TrueType font rendering using CLX and XRender extension.";
90 deps = with pkgs.lispPackages; [
91 alexandria bordeaux-threads cl-aa cl-fad cl-paths cl-paths-ttf cl-store
92 cl-vectors clx trivial-features zpb-ttf
95 url = "http://beta.quicklisp.org/archive/clx-truetype/2016-08-25/clx-truetype-20160825-git.tgz";
96 sha256 = "0ndy067rg9w6636gxwlpnw7f3ck9nrnjb03444pprik9r3c9in67";
99 packageName = "clx-truetype";
101 asdFilesToKeep = ["clx-truetype.asd"];
103 cluffer = buildLispPackage rec {
104 baseName = "cluffer";
105 version = "2018-09-24";
107 buildSystems = [ "cluffer-base" "cluffer-simple-buffer" "cluffer-simple-line" "cluffer-standard-buffer" "cluffer-standard-line" "cluffer" ];
108 parasites = [ "cluffer-test" ];
110 description = "General purpose text-editor buffer";
111 deps = with pkgs.lispPackages; [
114 src = pkgs.fetchFromGitHub {
115 owner = "robert-strandh";
117 rev = "4aad29c276a58a593064e79972ee4d77cae0af4a";
118 sha256 = "1bcg13g7qb3dr8z50aihdjqa6miz5ivlc9wsj2csgv1km1mak2kj";
119 # date = 2018-09-24T04:45:36+02:00;
122 packageName = "cluffer";
124 asdFilesToKeep = [ "cluffer.asd" "cluffer-base.asd" "cluffer-simple-buffer.asd" "cluffer-simple-line.asd" "cluffer-standard-buffer.asd" "cluffer-standard-line.asd" ];
126 nyxt = pkgs.lispPackages.buildLispPackage rec {
130 description = "Browser";
134 echo "Building nyxt binary"
136 source "$out/lib/common-lisp-settings"/*-shell-config.sh
137 cd "$out/lib/common-lisp"/*/
138 makeFlags="''${makeFlags:-}"
139 make LISP=common-lisp.sh NYXT_INTERNAL_QUICKLISP=false PREFIX="$out" $makeFlags all
140 make LISP=common-lisp.sh NYXT_INTERNAL_QUICKLISP=false PREFIX="$out" $makeFlags install
141 cp nyxt "$out/bin/nyxt"
143 NIX_LISP_PRELAUNCH_HOOK='
144 nix_lisp_build_system nyxt/gtk-application \
145 "(asdf/system:component-entry-point (asdf:find-system :nyxt/gtk-application))" \
146 "" "(format *error-output* \"Alien objects:~%~s~%\" sb-alien::*shared-objects*)"
147 ' "$out/bin/nyxt-lisp-launcher.sh"
148 cp "$out/lib/common-lisp/nyxt/nyxt" "$out/bin/"
151 # Prevent nyxt from trying to obtain dependencies as submodules
152 makeFlags = [ "NYXT_SUBMODULES=false" ] ++ x.buildFlags or [];
154 patches = x.patches or [] ++ [
155 # Work around crash when opening _any_ URL
156 # https://github.com/atlas-engineer/nyxt/issues/1781
157 # https://github.com/NixOS/nixpkgs/issues/158005
159 name = "nyxt-webkit-disable-sandbox.patch";
160 url = "https://github.com/atlas-engineer/nyxt/commit/48ac0d8727f1ca1428188a1ab2c05b7be5f6cc51.patch";
161 sha256 = "0570mcfn5wmjha6jmfdgglp0w5b7rpfnv3flzn77clgbknwbxi0m";
166 deps = with pkgs.lispPackages; [
202 trivial-package-local-nicknames
206 hu_dot_dwim_dot_defclass-star
211 cl-gobject-introspection
213 src = pkgs.fetchFromGitHub {
214 owner = "atlas-engineer";
217 sha256 = "12l7ir3q29v06jx0zng5cvlbmap7p709ka3ik6x29lw334qshm9b";
220 packageName = "nyxt";
222 propagatedBuildInputs = [
229 mgl = buildLispPackage rec {
231 version = "2021-10-07";
232 description = "MGL is a machine learning library for backpropagation neural networks, boltzmann machines, gaussian processes and more";
233 deps = with pkgs.lispPackages; [
234 alexandria closer-mop array-operations lla cl-reexport mgl-mat mgl-pax
235 named-readtables pythonic-string-reader
237 src = pkgs.fetchFromGitHub {
240 rev = "e697791a9bcad3b6e7b3845246a2aa55238cfef7";
241 sha256 = "sha256:09sf7nq7nmf9q7bh3a5ygl2i2n0nhrx5fk2kv5ili0ckv7g9x72s";
242 # date = 2021-10-18T14:15+02:00
244 buildSystems = [ "mgl" "mgl/test" ];
246 parasites = [ "mgl/test" ];
247 asdFilesToKeep = [ "mgl.asd" "mgl-example.asd" "gnuplot/mgl-gnuplot.asd" "visuals/mgl-visuals.asd" ];
250 mgl-mat = buildLispPackage rec {
251 baseName = "mgl-mat";
252 version = "2021-10-11";
253 description = "Multi-dimensional arrays with FFI/CUDA support";
254 deps = with pkgs.lispPackages; [
255 alexandria bordeaux-threads cffi cffi-grovel cl-cuda flexi-streams ieee-floats
256 lla mgl-pax static-vectors trivial-garbage cl-fad
258 src = pkgs.fetchFromGitHub {
261 rev = "3710858bc876b1b86e50f1db2abe719e92d810e7";
262 sha256 = "sha256:1aa2382mi55rp8pd31dz4d94yhfzh30vkggcvmvdfrr4ngffj0dx";
263 # date = 2021-10-18T14:15+02:00
265 packageName = "mgl-mat";
266 buildSystems = [ "mgl-mat" "mgl-mat/test" ];
267 parasites = [ "mgl-mat/test" ];
268 asdFilesToKeep = [ "mgl-mat.asd" ];