about summary refs log tree commit diff
path: root/pkgs/tools/networking/pwnat/default.nix
blob: ab123973c0a1b9ab52568b84a18f287fcdeaf0ec (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
38
39
40
{ lib
, stdenv
, fetchFromGitHub
}:

stdenv.mkDerivation rec {
  pname = "pwnat";
  # Latest release has an annoying segmentation fault bug, see:
  # https://github.com/samyk/pwnat/pull/25 . Merging only #25 is impossible due
  # to major code refactoring.
  version = "2023-03-31";

  src = fetchFromGitHub {
    owner  = "samyk";
    repo   = pname;
    rev    = "8ec62cdae53a2d573c9f9c906133ca45bbd3360a";
    sha256 = "sha256-QodNw3ab8/TurKamg6AgMfQ08aalp4j6q663B+sWmRM=";
  };

  # See https://github.com/samyk/pwnat/issues/28
  preBuild = ''
    mkdir obj
  '';

  installPhase = ''
    runHook preInstall

    install -D pwnat $out/bin/pwnat

    runHook postInstall
  '';

  meta = with lib; {
    homepage    = "http://samy.pl/pwnat/";
    description = "ICMP NAT to NAT client-server communication";
    license     = lib.licenses.gpl3Plus;
    maintainers = with maintainers; [viric];
    platforms   = with platforms; linux;
  };
}