This repository contains a Nix template for Common Lisp projects.
The entrypoint of this project is main
function.
You can run it with the following command:
nix run .#main-sbcl
.#main-sbcl
: Run the entrypoint using SBCL..#main-ecl
: Run the entrypoint using ECL..#main-abcl
: Run the entrypoint using ABCL..#main-ccl
: Run the entrypoint using CCL..#main-mkcl
: Run the entrypoint using MKCL..#main-clisp
: Run the entrypoint using CLISP..#main-cmucl_binary
: Run the entrypoint using CMUCL..#main-clasp-common-lisp
: Run the entrypoint using Clasp.
The tests of this project are located in the test
directory.
You can run them with the following command:
nix run .#test-sbcl
We use FiveAM for testing.
.#test-sbcl
: Run all tests using SBCL..#test-ecl
: Run all tests using ECL..#test-abcl
: Run all tests using ABCL..#test-ccl
: Run all tests using CCL..#test-mkcl
: Run all tests using MKCL..#test-clisp
: Run all tests using CLISP..#test-cmucl_binary
: Run all tests using CMUCL..#main-clasp-common-lisp
: Run all tests using Clasp.
You can also run the test with code coverage using the following command:
.#coverage-sbcl
: Run all tests with code coverage using SBCL.
You can run a REPL with the following command:
nix develop -c sbcl # ecl, abcl, or ccl, mkcl, lisp, clisp, clasp
To load the project, you can use the following code:
(require :uiop)
(load (uiop:getenv "ASDF"))
(require :fibonacci)
This project exports the following packages:
-
packages.lib-sbcl
: library for SBCL. -
packages.lib-ecl
: library for ECL. -
packages.lib-abcl
: library for ABCL. -
packages.lib-ccl
: library for CCL. -
packages.lib-mkcl
: library for MKCL. -
packages.lib-clisp
: library for CLISP. -
packages.lib-cmucl_binary
: library for CMUCL. -
packages.lib-clasp-common-lisp
: library for Clasp. -
packages.main-sbcl
: executable for SBCL. -
packages.main-ecl
: executable for ECL. -
packages.main-abcl
: executable for ABCL. -
packages.main-ccl
: executable for CCL. -
packages.main-mkcl
: executable for MKCL. -
packages.main-clisp
: executable for CLISP. -
packages.main-cmucl_binary
: executable for CMUCL. -
packages.main-clasp-common-lisp
: executable for Clasp.
This project exports the overlay.
overlays.default
: it adds following packages:-
pkgs.fibonacci-sbcl
: it is equivalent topackages.main-sbcl
. -
pkgs.fibonacci-ecl
: it is equivalent topackages.main-ecl
. -
pkgs.fibonacci-abcl
: it is equivalent topackages.main-abcl
. -
pkgs.fibonacci-ccl
: it is equivalent topackages.main-ccl
. -
pkgs.fibonacci-mkcl
: it is equivalent topackages.main-mkcl
. -
pkgs.fibonacci-clisp
: it is equivalent topackages.main-clisp
. -
pkgs.fibonacci-cmucl_binary
: it is equivalent topackages.main-cmucl_binary
. -
pkgs.fibonacci-clasp-common-lisp
: it is equivalent topackages.main-clasp-common-lisp
. -
pkgs.sbcl.fibonacci
: it is equivalent topackages.lib-sbcl
. -
pkgs.ecl.fibonacci
: it is equivalent topackages.lib-ecl
. -
pkgs.abcl.fibonacci
: it is equivalent topackages.lib-abcl
. -
pkgs.ccl.fibonacci
: it is equivalent topackages.lib-ccl
. -
pkgs.mkcl.fibonacci
: it is equivalent topackages.lib-mkcl
. -
pkgs.clisp.fibonacci
: it is equivalent topackages.lib-clisp
. -
pkgs.cmucl_binary.fibonacci
: it is equivalent topackages.lib-cmucl_binary
. -
pkgs.clasp-common-lisp.fibonacci
: it is equivalent topackages.lib-clasp-common-lisp
.
-
To use the overlay,
let
pkgs = import nixpkgs {
inherit system;
overlays = [
fibonacci.overlays.default
];
};
in
# You can use packages such as pkgs.fibonacci-sbcl
First, you need to rename the project name. We attached the rename script for this purpose.
vim ./rename.sh # Edit the project name
./rename.sh
Then, you might update the dependency (lispLibs
).
Now you can start developing your project. Note that this project uses package-inferred-system.
This project is inspired by Comamoca/nix-template, which is licensed under the CC0 1.0 Universal license.
This projects is licensed under the following license:
MIT No Attribution
Copyright 2024 Masaya Taniguchi
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.