about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/beam-modules/hex-registry-snapshot.nix
blob: fbd2950b6d53b48d3fde46b4c26325bcf76cbfb6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{stdenv, writeText, fetchFromGitHub }:

stdenv.mkDerivation rec {
    pname = "hex-registry";
    rev = "11d7a24e9f53f52490ce255a6248e71128e73aa1";
    version = "unstable-2018-07-12";

    src = fetchFromGitHub {
        inherit rev;
        owner  = "erlang-nix";
        repo   = "hex-pm-registry-snapshots";
        sha256 = "0dbpcrdh6jqmvnm1ysmy7ixyc95vnbqmikyx5kk77qwgyd43fqgi";
    };

    installPhase = ''
       mkdir -p "$out/var/hex"
       zcat "registry.ets.gz" > "$out/var/hex/registry.ets"
    '';

    setupHook = writeText "setupHook.sh" ''
        export HEX_REGISTRY_SNAPSHOT="$1/var/hex/registry.ets"
   '';

    meta = {
        platforms = stdenv.lib.platforms.unix;
    };
}