1{ lib, buildGoModule, fetchFromGitHub, installShellFiles, jemalloc, nodejs }:
2
3buildGoModule rec {
4 pname = "dgraph";
5 version = "22.0.1";
6
7 src = fetchFromGitHub {
8 owner = "dgraph-io";
9 repo = "dgraph";
10 rev = "v${version}";
11 sha256 = "sha256-c4gNkT1N1yPotDhRjZvuVvO5TTaL2bqR5I+Z2PcvW10=";
12 };
13
14 vendorSha256 = "sha256-K2Q2QBP6fJ3E2LEmZO2U/0DiQifrJVG0lcs4pO5yqrY=";
15
16 doCheck = false;
17
18 ldflags = [
19 "-X github.com/dgraph-io/dgraph/x.dgraphVersion=${version}-oss"
20 ];
21
22 tags = [
23 "oss"
24 ];
25
26 nativeBuildInputs = [ installShellFiles ];
27
28 # todo those dependencies are required in the makefile, but verify how they are used
29 # actually
30 buildInputs = [ jemalloc nodejs ];
31
32 subPackages = [ "dgraph" ];
33
34 postInstall = ''
35 for shell in bash zsh; do
36 $out/bin/dgraph completion $shell > dgraph.$shell
37 installShellCompletion dgraph.$shell
38 done
39 '';
40
41 meta = with lib; {
42 homepage = "https://dgraph.io/";
43 description = "Fast, Distributed Graph DB";
44 maintainers = with maintainers; [ sigma ];
45 # Apache 2.0 because we use only build "oss"
46 license = licenses.asl20;
47 };
48}