mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-11 15:27:20 +03:00
35 lines
565 B
Nix
35 lines
565 B
Nix
{ stdenv, fetchurl }:
|
|
|
|
{ pkg, version, sha256
|
|
, meta ? {}
|
|
}:
|
|
|
|
with stdenv.lib;
|
|
|
|
stdenv.mkDerivation ({
|
|
name = "hex-source-${pkg}-${version}";
|
|
|
|
src = fetchurl {
|
|
url = "https://repo.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;
|
|
})
|