Sadly. This does seem to be a bit of a quagmire at present, with lots of the information out there being obsoleted.
We are heavy users of nix for our development environments, and generally interested in packaging Erlang applications with nix too. We do that today in one project by using rebar3 to build outside of nix, and then we have a nix derivation that uses the built asset as its source. That’s very much an expedient hack though, and not where we want to be.
I’d originally looked at using Announcing Rebar32nix, which, for Erlang, looks to me like the right approach, but wasn’t viable when I used it because most of the beam capabilities had already been removed from nixpkgs by that point.
There are also some prior discussions around this that are worth looking at, e.g. State of the BEAM Ecosystem in Nix - #6 by DianaOlympos
I’d be pretty interested in getting this conversation going again, and chiming in from the Erlang point of view. I don’t have any experience of Elixir, so I can’t comment about specifics there.
On another note, I maintain GitHub - id3as/nixpkgs-nixerl: A nix overlay for Erlang Releases, which I created as a sort-of replacement for kerl (which serves a similar function to asdf) in a nix world. It specifically makes most released versions of Erlang available for use.