about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/sn/snicat/package.nix
blob: bbc3fded5b2f1a0ed3661a9d6d90dc621f07728d (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
28
29
30
31
32
33
34
35
36
37
{ lib
, buildGoPackage
, fetchFromGitHub
}:
buildGoPackage rec {
  pname = "snicat";
  version = "0.0.1";

  src = fetchFromGitHub {
    owner = "CTFd";
    repo = "snicat";
    rev = version;
    hash = "sha256-fFlTBOz127le2Y7F9KKhbcldcyFEpAU5QiJ4VCAPs9Y=";
  };

  goPackagePath = "github.com/CTFd/snicat";

  goDeps = ./deps.nix;

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

  installPhase = ''
    runHook preInstall

    install -Dm555 go/bin/snicat $out/bin/sc

    runHook postInstall
  '';

  meta = with lib; {
    description = "TLS & SNI aware netcat";
    homepage = "https://github.com/CTFd/snicat";
    license = licenses.asl20;
    mainProgram = "sc";
    maintainers = with maintainers; [ felixalbrigtsen ];
  };
}