use lib only where required

use standard phases
This commit is contained in:
happysalada 2021-02-01 09:58:51 +09:00
parent 39c85b0bcf
commit f38079ff95

View File

@ -1,14 +1,10 @@
{ stdenvNoCC, elixir, hex, rebar, rebar3, cacert, git }: { stdenvNoCC, lib, elixir, hex, rebar, rebar3, cacert, git }:
{ name, version, sha256, src, mixEnv ? "prod", debug ? false, meta ? { } }: { name, version, sha256, src, mixEnv ? "prod", debug ? false, meta ? { } }:
with stdenvNoCC.lib;
stdenvNoCC.mkDerivation ({ stdenvNoCC.mkDerivation ({
name = "mix-deps-${name}-${version}"; name = "mix-deps-${name}-${version}";
phases = [ "configurePhase" "downloadPhase" ];
nativeBuildInputs = [ elixir hex cacert git ]; nativeBuildInputs = [ elixir hex cacert git ];
inherit src; inherit src;
@ -29,9 +25,9 @@ stdenvNoCC.mkDerivation ({
export REBAR_CACHE_DIR="$TMPDIR/rebar3.cache" export REBAR_CACHE_DIR="$TMPDIR/rebar3.cache"
''; '';
downloadPhase = '' dontBuild = true;
ln -s ${src}/mix.exs ./mix.exs
ln -s ${src}/mix.lock ./mix.lock installPhase = ''
mix deps.get --only ${mixEnv} mix deps.get --only ${mixEnv}
''; '';
@ -39,6 +35,6 @@ stdenvNoCC.mkDerivation ({
outputHashMode = "recursive"; outputHashMode = "recursive";
outputHash = sha256; outputHash = sha256;
impureEnvVars = stdenvNoCC.lib.fetchers.proxyImpureEnvVars; impureEnvVars = lib.fetchers.proxyImpureEnvVars;
inherit meta; inherit meta;
}) })