Announcing Mixnix - Build Elixir projects with Nix

#1

This is the first step on a path to better support for Elixir and Erlang via Nix.
So far it’s been nearly impossible to build arbitrary projects with Nix, given that the versions of BEAM packages in nixpkgs are outdated and incomplete.
The current approach is also not sustainable, given the amount of changes happening on hex.pm.

The approach I’ve taking is similar to what moretea did with yarn2nix: given a lock file we want to create a derivation on the fly, and if IFD is an issue, create a nix-readable lockfile to speed up builds.
Also important was for me a bundix-like approach to per-package configuration and a preset of common hacks needed to get certain packages to build.

You can find the result at https://gitlab.com/manveru/mixnix and give it a go.

I’d be especially thankful for suggestions of projects that are worth packaging for nixpkgs that have been ignored so far because it was too hard.

I’d also like to give a special thanks to all the people who’ve worked on the BEAM packaging support in nixpkgs. This wouldn’t have been possible without all their hard work that this is based on.

10 Likes
#2

That’s cool! :+1:
It would probably be a good idea to also add mix-to-nix to the “Related Work” section and have some sort of comparison between the two.

1 Like
#3

Damn, I wish I’d found this earlier that’d have saved me a ton of work, but even after days of searching for anything related to Elixir and Nix this project didn’t show up for me.

I’ll have to take a closer look, but it seems nearly identical. MixNix has better support for git dependencies and a common override system but it lacks the fake hex registry (I’m just using a snapshot placed in the repo). MixNix also generates a .nix file for the lock so it’s possible to use it without import-from-derivation and is more suitable for inclusion of packages in nixpkgs.

The MixNix usage is also more similar to how Bundix and Yarn2nix work.

When I get some time I can do some better comparison and will include it in the docs. It’s just fun to see how similar the two solutions are, so I think we’re on to something here.

1 Like