diff options
Diffstat (limited to 'pkgs/development/tools/build-managers/rebar3/fetch-hex.nix')
-rw-r--r-- | pkgs/development/tools/build-managers/rebar3/fetch-hex.nix | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/pkgs/development/tools/build-managers/rebar3/fetch-hex.nix b/pkgs/development/tools/build-managers/rebar3/fetch-hex.nix new file mode 100644 index 00000000000..1b1378c10cb --- /dev/null +++ b/pkgs/development/tools/build-managers/rebar3/fetch-hex.nix @@ -0,0 +1,34 @@ +{ stdenv, fetchurl }: + +{ pkg, version, sha256 +, meta ? {} +}: + +with stdenv.lib; + +stdenv.mkDerivation ({ + name = "hex-source-${pkg}-${version}"; + + src = fetchurl { + url = "https://s3.amazonaws.com/s3.hex.pm/tarballs/${pkg}-${version}.tar"; + inherit sha256; + }; + + phases = [ "unpackPhase" "installPhase" ]; + + unpackCmd = '' + tar -xf $curSrc contents.tar.gz + mkdir contents + tar -C contents -xzf contents.tar.gz + ''; + + installPhase = '' + runHook preInstall + mkdir "$out" + cp -Hrt "$out" . + success=1 + runHook postInstall + ''; + + inherit meta; +}) |