Trying to build a erlang application in a flake

I’ve found:
rebar3 nix lock
and it builds a rebar3-deps.nix with all dependencies. I can use it to get all dependencies with
callPackage ./rebar-deps.nix { inherit fetchHex; inherit fetchFromGitHub; };

How can I include these derivations in my flake? My first impression would be to link them to _checkouts but my nix isn’t good enough…

Where should I look for help