Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

datalevin-flake

Nix flake for Datalevin. Builds both the JVM uberjar and the GraalVM native binary (dtlv) using clj-nix.

Usage

# Build the native binary (default)
nix build github:noblepayne/datalevin-flake

# Build just the JVM uberjar
nix build github:noblepayne/datalevin-flake#clj-bin

# Build the patched uberjar
nix build github:noblepayne/datalevin-flake#uberjar

# Run directly
nix run github:noblepayne/datalevin-flake

# Dev shell with JDK, Clojure, Leiningen, and GraalVM
nix develop github:noblepayne/datalevin-flake

# Run all checks
nix flake check

Outputs

Attribute Description
packages.dtlv GraalVM native binary
packages.clj-bin JVM uberjar with wrapper script
packages.uberjar JVM uberjar only
devShells.default Development shell (JDK, Clojure, Leiningen, GraalVM)
checks.* Build validation tests

Build Steps

  1. Source is fetched from github:datalevin/datalevin.
  2. deps-lock.json is injected for offline Maven dependency resolution.
  3. deps.edn is patched to include resources/ on the classpath. This ensures GraalVM native-image metadata ends up in the uberjar.
    • TODO: change upstream?
  4. clj-nix builds the uberjar via mkCljApp.
  5. The uberjar's reachability-metadata.json is patched with jq to work around a GraalVM 25.0.1 assertion bug (setting unsafeAllocated from true to false).
  6. buildGraalvmNativeImage compiles the patched jar into the dtlv native binary.

License

EPL-2.0

About

A Nix flake for the Datalevin Datalog database.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages