about summary refs log tree commit diff
path: root/pkgs/tools/networking/norouter/default.nix
blob: efc50fbad2ad030919bc902b4cb87b430a02d71c (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
{ lib
, buildGoModule
, fetchFromGitHub
}:

buildGoModule rec {
  pname = "norouter";
  version = "0.6.5";

  src = fetchFromGitHub {
    owner = "norouter";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-EY/Yfyaz2DeQKHJ4awpQDbrVkse9crIZlLzfviPy3Tk=";
  };

  vendorHash = "sha256-RxrmYfEm1Maq8byoLXUr5RfXcwgqpCcAq5enMnl9V9E=";

  subPackages = [ "cmd/norouter" ];
  doInstallCheck = true;
  installCheckPhase = ''
    runHook preInstallCheck

    $out/bin/norouter --version | grep ${version} > /dev/null

    runHook postInstallCheck
  '';

  meta = with lib; {
    # Doesn't build with Go >=1.21
    # https://github.com/norouter/norouter/issues/165
    broken = true;
    description = "Tool to handle unprivileged networking by using multiple loopback addresses";
    homepage = "https://github.com/norouter/norouter";
    license = licenses.asl20;
    maintainers = with maintainers; [ blaggacao ];
    mainProgram = "norouter";
  };
}