1 { lib, stdenv, fetchurl }:
17 url = "https://repo.hex.pm/tarballs/${pkg}-${version}.tar";
22 tar -xf $curSrc contents.tar.gz CHECKSUM metadata.config
24 tar -C contents -xzf contents.tar.gz
25 mv metadata.config contents/hex_metadata.config
27 # To make the extracted hex tarballs appear legitimate to mix, we need to
28 # make sure they contain not just the contents of contents.tar.gz but also
29 # a .hex file with some lock metadata.
30 # We use an old version of .hex file per hex's mix_task_test.exs since it
31 # is just plain-text instead of an encoded format.
32 # See: https://github.com/hexpm/hex/blob/main/test/hex/mix_task_test.exs#L410
33 echo -n "${pkg},${version},$(cat CHECKSUM | tr '[:upper:]' '[:lower:]'),hexpm" > contents/.hex