Manifest2Nix.jl, a build tool for Julia

I created Manifest2Nix.jl (also on GitHub) for building Julia projects. This library works in a similar way to crane and lean4-nix.

For a simple example, execute

nix flake new --template github:lenianiva/Manifest2Nix.jl#simple ./simple
cd simple
nix build

This builds a simple Julia library and runs a random sampling experiment, with the output of the experiment written at result.

> cat result
1.0480426577669817

Manifest2Nix.jl reads in the manifest file and downloads version-pinned packages ensuring reproducibility. I use this tool to build experiment docker containers that run on the GPU.

8 Likes

That’s great. I was just checking around the julia ecosystem again.

I also found a post on pkgs.julia.withPackages that was apparently merged into nixpkgs recently.

What’s the difference between this and your method?

A bit off-topic, but I’m specifically interested in finding a language that makes working with ROCm a bit easier on nixos. I may write up a post about a degenerate symlinkJoin method that seems to work alright. It probably needs a bit of feedback, but in theory it “works”. it almost lets me link foreign packages from uv against what I have set up in /opt/rocm, but i think i need to build the UV packages locally.

Anyways, I’ve never been thrilled with the python ecosystem. uv helps a lot, but it’s still difficult to reason about when working on a NixOS desktop and an Arch laptop. I always liked Julia a lot.

The main difference is Manifest2Nix.jl extracts the version information from a manifest file (like crane for Rust) and can build modular depots for caching purposes.

I tried using ROCm and ZLUDA with Manifest2Nix.jl and they seem to work fine on small scales.