Commit 3aa3566f authored by Fabian Affolter's avatar Fabian Affolter
Browse files

newt-go: init at 1.1.3

Tunneling client for Pangolin

https://github.com/fosrl/newt
parent 616e3819
Loading
Loading
Loading
Loading
+45 −0
Original line number Diff line number Diff line
{
  lib,
  buildGoModule,
  fetchFromGitHub,
  versionCheckHook,
}:

buildGoModule rec {
  pname = "newt";
  version = "1.1.3";

  src = fetchFromGitHub {
    owner = "fosrl";
    repo = "newt";
    tag = version;
    hash = "sha256-wfm2UI4QUiYiAJIYBiSCOD/w72WRJIv2cyLIkfqGsek=";
  };

  vendorHash = "sha256-8VlT9cy2uNhQPiUpr1jJuQSgUR6TtlbQ+etran2Htxs=";

  postPatch = ''
    substituteInPlace main.go \
      --replace-fail "replaceme" "${version}"
  '';

  nativeInstallCheckInputs = [ versionCheckHook ];

  ldflags = [
    "-s"
    "-w"
  ];

  doInstallCheck = true;

  versionCheckProgramArg = [ "-version" ];

  meta = {
    description = "Tunneling client for Pangolin";
    homepage = "https://github.com/fosrl/newt";
    changelog = "https://github.com/fosrl/newt/releases/tag/${src.tag}";
    license = lib.licenses.agpl3Only;
    maintainers = with lib.maintainers; [ fab ];
    mainProgram = "newt";
  };
}