Home

Awesome

clojure-nix-locker

Simple and flexible tool to build clojure projects with Nix.

Usage

The example/ directory has a small clojure program and the nix code required to build it.

Stable non-flake way

To generate/update the lockfile:

nix-shell --run clojure-nix-locker

To build:

nix-build -A uberjar

With flakes

You can generate a flake example with:

mkdir play-with-clojure-nix-locker && cd play-with-clojure-nix-locker && nix flake init -t github:bevuta/clojure-nix-locker

The example README has some next steps.

Why another tool?

There are two existing projects with a similar goal already, clj2nix and clj-nix. Both of these are designed to be used roughly like this:

By contrast, clojure-nix-locker is designed around letting classpath computation happen later, at build-time. It works roughly like this:

This approach results in a pretty simple implementation and loose coupling to the clojure tooling. As a consequence, things like aliases "just work" without requiring clojure-nix-locker to know about them.

Of course, this has its downsides too:

License

Distributed under the GNU General Public License, Version 3. See LICENSE for more details.