# \[ANN\] Manifest2Nix.jl

**URL:** <https://discourse.julialang.org/t/ann-manifest2nix-jl/133315>\
**Category:** Tooling\
**Tags:** announcement, environment, reproducibility, nixos\
**Created:** [October 20, 2025, 6:03pm UTC](https://discourse.julialang.org/t/ann-manifest2nix-jl/133315 "2025-10-20T18:03:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chrysoberyl](https://avatars.discourse-cdn.com/v4/letter/c/ed655f/32.png) [@Chrysoberyl](https://discourse.julialang.org/u/Chrysoberyl)\
**Post date:** [October 20, 2025, 6:03pm UTC](https://discourse.julialang.org/t/ann-manifest2nix-jl/133315/1 "2025-10-20T18:03:09Z")

</div>

I wrote a Nix library for creating reproducible environments in Julia called [GitHub - lenianiva/Manifest2Nix.jl: (Mirror) A Nix library for creating reproducible Julia builds.](https://github.com/lenianiva/Manifest2Nix.jl) (also hosted on Codeberg).

For a simple example, execute

```sh
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`.

```sh
> cat result
1.0480426577669817

```

It uses Nix to sandbox a environment for Julia to ensure reproducibility. The resulting Nix derivation can also be piped into docker images for running on shared computing clusters.

This library also provides a Julia executable based on an input manifest version.

---

<div class="post-metadata">

**Author:** ![RomeoV](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/romeov/32/37687_2.png) [@RomeoV](https://discourse.julialang.org/u/RomeoV)\
**Post date:** [October 20, 2025, 7:12pm UTC](https://discourse.julialang.org/t/ann-manifest2nix-jl/133315/2 "2025-10-20T19:12:35Z")

</div>

Looks great. I see that you’re using `julia-bin` for the executable, which I agree seems to be the way to go, although I am still mystified why `julia` doesn’t build nicely on nix.

Do you know if there’s any way forward to have nice precompile hashing as part of the nix flake as well? It would be awesome to be able to run `nix run mychannel#juliaflake` and have it pull in the dependencies alongside the precompile targets so that everything runs quickly.  
This avenue becomes even more interesting with the julia 1.12 `apps`. I think `runic` could be an interesting case study for this, how fast (TTFX) one can run a julia app on a fresh nix-available machine.

---

<div class="post-metadata">

**Author:** ![Chrysoberyl](https://avatars.discourse-cdn.com/v4/letter/c/ed655f/32.png) [@Chrysoberyl](https://discourse.julialang.org/u/Chrysoberyl)\
**Post date:** [October 20, 2025, 7:16pm UTC](https://discourse.julialang.org/t/ann-manifest2nix-jl/133315/3 "2025-10-20T19:16:03Z")

</div>

I’m not using `julia-bin` as the executable. It is one of the options available, but I encourage people to use the manifest version overlay since Julia version could be finely adjusted.

if you want to precompile all the depots and cache them in Nix, use

```nix
cachedDepot = lib-compile.mkDepsDepot [package];

```

or

```nix
cachedPackage = package.compiled

```

Vide [checks.nix](https://codeberg.org/aniva/Manifest2Nix.jl/src/branch/main/test/checks.nix)

Another way to do this is to use `devShell` and `createEnv`, so the shell itself gets cached.

I’ll modify the documentation to describe this usage.

---

<div class="post-metadata">

**Author:** ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Post date:** [October 21, 2025, 5:32am UTC](https://discourse.julialang.org/t/ann-manifest2nix-jl/133315/4 "2025-10-21T05:32:32Z")

</div>

What is `nix` ?

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [October 21, 2025, 7:49am UTC](https://discourse.julialang.org/t/ann-manifest2nix-jl/133315/5 "2025-10-21T07:49:34Z")

</div>

> **[Nix & NixOS | Declarative builds and deployments](https://nixos.org/)**
>
> Nix is a tool that takes a unique approach to package management and system configuration. Learn how to make reproducible, declarative and reliable systems.

---

<div class="post-metadata">

**Author:** ![Chrysoberyl](https://avatars.discourse-cdn.com/v4/letter/c/ed655f/32.png) [@Chrysoberyl](https://discourse.julialang.org/u/Chrysoberyl)\
**Post date:** [October 21, 2025, 8:37am UTC](https://discourse.julialang.org/t/ann-manifest2nix-jl/133315/6 "2025-10-21T08:37:14Z")

</div>

Regarding building from source, I have a [plan to build from source](https://codeberg.org/aniva/Manifest2Nix.jl/issues/19), and I think it is doable within Nix. However just looking from rust-overlay and lean4-nix, it seems like not many people care about source builds.
