<commit_before>{ lib, stdenv, rebar3 }:

{ name
, version
, sha256
, src
, meta ? { }
}:

with lib;

stdenv.mkDerivation ({
  pname = "rebar-deps-${name}";
  inherit version;

  dontUnpack = true;

  prePhases = ''
    cp ${src} .
    HOME='.' DEBUG=1 ${rebar3}/bin/rebar3 get-deps
  '';

  installPhase = ''
    runHook preInstall
    mkdir -p "$out/_checkouts"
    for i in ./_build/default/lib/* ; do
       echo "$i"
       cp -R "$i" "$out/_checkouts"
    done
    runHook postInstall
  '';

  outputHashAlgo = "sha256";
  outputHashMode = "recursive";
  outputHash = sha256;

  impureEnvVars = lib.fetchers.proxyImpureEnvVars;
  inherit meta;
})
<commit_msg>fetch-rebar-deps: phases deprecation fix<commit_after>{ lib, stdenv, rebar3 }:

{ name
, version
, sha256
, src
, meta ? { }
}:

with lib;

stdenv.mkDerivation ({
  pname = "rebar-deps-${name}";
  inherit version;

  dontUnpack = true;
  dontConfigure = true;
  dontBuild = true;
  dontFixup = true;

  prePhases = ''
    cp ${src} .
    HOME='.' DEBUG=1 ${rebar3}/bin/rebar3 get-deps
  '';

  installPhase = ''
    runHook preInstall
    mkdir -p "$out/_checkouts"
    for i in ./_build/default/lib/* ; do
       echo "$i"
       cp -R "$i" "$out/_checkouts"
    done
    runHook postInstall
  '';

  outputHashAlgo = "sha256";
  outputHashMode = "recursive";
  outputHash = sha256;

  impureEnvVars = lib.fetchers.proxyImpureEnvVars;
  inherit meta;
})

{'fraction_non_alphanumeric': 0.14869626497533475, 'fraction_numerical': 0.018322762508809022, 'mean_word_length': 2.848238482384824, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2645622', 'n_tokens_mistral': 564, 'n_tokens_neox': 545, 'n_words': 119}