summaryrefslogtreecommitdiff
path: root/pkgs/by-name/al/alpaca-proxy/package.nix
blob: 7489aadc367574303228cb066739fd055cc081cc (about) (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
38
39
{
  lib,
  buildGoModule,
  fetchFromGitHub,
}:
buildGoModule rec {
  pname = "alpaca-proxy";
  version = "2.0.11";

  src = fetchFromGitHub {
    owner = "samuong";
    repo = "alpaca";
    tag = "v${version}";
    hash = "sha256-74JQ9ltJ7+sasySgNN3AaXlBILP7VgFN06adoNJG+Bc=";
  };

  vendorHash = "sha256-N9qpyCQg6H1v/JGJ2wCxDX+ZTM9x6/BM6wQ26xC+dlE=";

  ldflags = [
    "-s"
    "-w"
    "-X=main.BuildVersion=v${version}"
  ];

  postInstall = ''
    # executable is renamed to alpaca-proxy, to avoid collision with the alpaca python application
    mv $out/bin/alpaca $out/bin/alpaca-proxy
  '';

  meta = with lib; {
    description = "HTTP forward proxy with PAC and NTLM authentication support";
    homepage = "https://github.com/samuong/alpaca";
    changelog = "https://github.com/samuong/alpaca/releases/tag/v${src.rev}";
    license = licenses.asl20;
    platforms = platforms.linux ++ platforms.darwin;
    maintainers = with maintainers; [ _1nv0k32 ];
    mainProgram = "alpaca-proxy";
  };
}