DEV Community

Cover image for Perfect Elixir: Setting Up an Elixir Dev Environment

Perfect Elixir: Setting Up an Elixir Dev Environment

Jon Lauridsen on March 18, 2024

We need Erlang and Elixir installed, which might sound simple, but there are trade-offs to consider for a shared team environment. We'll also add a...
Collapse
 
03juan profile image
Juan Barrios

Great breakdown of the contemporary options. I use asdf with direnv and know of nix, but its configuration seemed pretty daunting and just another rabbit hole to go down. Thanks for introducing pkgx, looks very sleek and will definitely try it out.

I wonder what the journey is like with nix and pkgx to install erlang and elixir with compiled source docs?

In asdf, erlang docs are installed by setting some env variables, and the elixir plugin will compile any github version tag or sha ref from scratch with e.g. asdf install elixir ref:v1.17.0-dev. This way you can navigate to any erlang or elixir function's source from your own codebase in an IDE.

Collapse
 
jonlauridsen profile image
Jon Lauridsen

Thanks for the feedback, and yeah I also wonder about that journey. We can see the pkgx Erlang package page here which leads to the actual pkgx package.yml definition here, and in that we can spot the familiar environment flags of --without-javac & friends. I guess we could make a PR that adds a configuration variant?

Very interesting to hear about the ability to navigate to built-in source, I can't quite find a link that describes this so if you have any resources (or can write a blog about it 😅) I'd be very happy to receive.

Collapse
 
03juan profile image
Juan Barrios

Yes absolutely, you're very welcome to write about it! Wish I had the time... 🫠

I posted a reply on the Elixir forum about this and as luck would have it the link was in my notifications as a recent popular link.

Please link your blog post to the form thread when you're done, I'm sure people would want to read it, too.

Collapse
 
devbrett-dot-com profile image
Brett Richardson

Mise also has the power of Direnv built into it... and a poor man's make-like task runner too.
IMO I think Mise offers the most complete solution and allowing teams to commit: ./.config/mise.toml with ./.config/mise.local.toml for local overrides is great!