aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/servers/gobetween/default.nix
blob: 9f28a89f51eba5aa0ae94891b33bf78df34e4db6 (plain)
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
28
29
30
31
32
33
34
35
36
37
{ buildGoModule, fetchFromGitHub, lib, enableStatic ? false }:

buildGoModule rec {
  pname = "gobetween";
  version = "0.8.0";

  src = fetchFromGitHub {
    owner = "yyyar";
    repo = "gobetween";
    rev = version;
    sha256 = "0bxf89l53sqan9qq23rwawjkcanv9p61sw56zjqhyx78f0bh0zbc";
  };

  patches = [
    ./gomod.patch
  ];

  buildPhase = ''
    make -e build${lib.optionalString enableStatic "-static"}
  '';

  vendorSha256 = "1nkni9ikpc0wngh5v0qmlpn5s9v85lb2ih22f3h3lih7nc29yv87";

  installPhase = ''
    mkdir -p $out/bin
    cp bin/gobetween $out/bin
    cp -r share $out/share
    cp -r config $out/share
  '';

  meta = with lib; {
    description = "Modern & minimalistic load balancer for the Сloud era";
    homepage = "http://gobetween.io";
    license = licenses.mit;
    maintainers = with maintainers; [ tomberek ];
  };
}