nixpkgs/pkgs/development/beam-modules/fetch-rebar-deps.nix

43 lines
701 B
Nix
Raw Normal View History

2021-01-23 17:15:07 +00:00
{ lib, stdenv, rebar3 }:
2021-08-16 21:09:48 +01:00
{ name
, version
, sha256
, src
, meta ? { }
}:
2021-01-23 17:15:07 +00:00
with lib;
stdenv.mkDerivation ({
2021-08-16 21:09:48 +01:00
pname = "rebar-deps-${name}";
inherit version;
2021-08-16 21:09:48 +01:00
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
dontFixup = true;
2021-08-16 21:09:48 +01:00
prePhases = ''
cp ${src} .
HOME='.' DEBUG=1 ${rebar3}/bin/rebar3 get-deps
'';
installPhase = ''
2021-08-16 21:09:48 +01:00
runHook preInstall
mkdir -p "$out/_checkouts"
for i in ./_build/default/lib/* ; do
echo "$i"
cp -R "$i" "$out/_checkouts"
done
2021-08-16 21:09:48 +01:00
runHook postInstall
'';
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = sha256;
2021-01-23 17:15:07 +00:00
impureEnvVars = lib.fetchers.proxyImpureEnvVars;
inherit meta;
})