···11+{ stdenv, lib, fetchgit }:
22+33+stdenv.mkDerivation {
44+ pname = "passt";
55+ version = "0.2023_11_10.5ec3634";
66+ src = fetchgit {
77+ url = "git://passt.top/passt";
88+ rev = "5ec3634b07215337c2e69d88f9b1d74711897d7d";
99+ hash = "sha256-76CD9PYD/NcBkmRYFSZaYl381QJjuWo0VsNdh31d6/M=";
1010+ };
1111+ nativeBuildInputs = [ ];
1212+ buildInputs = [];
1313+ installPhase = ''
1414+ runHook preInstall
1515+ mkdir -p $out/bin $out/share/man/man1
1616+ cp passt pasta qrap $out/bin/
1717+ cp passt.1 pasta.1 qrap.1 $out/share/man/man1/
1818+ '' + (lib.optionalString stdenv.hostPlatform.avx2Support ''
1919+ cp passt.avx2 pasta.avx2 $out/bin/
2020+ runHook postInstall
2121+ '');
2222+ meta = with lib; {
2323+ homepage = "https://passt.top/passt/about/";
2424+ description = "Translation layer between a Layer-2 network interface and native Layer-4 sockets";
2525+ longDescription = ''
2626+ passt implements a translation layer between a Layer-2 network interface
2727+ and native Layer-4 sockets (TCP, UDP, ICMP/ICMPv6 echo) on a host.
2828+ It doesn't require any capabilities or privileges, and it can be used as
2929+ a simple replacement for Slirp.
3030+3131+ pasta (same binary as passt, different command) offers equivalent
3232+ functionality, for network namespaces: traffic is forwarded using a tap
3333+ interface inside the namespace, without the need to create further
3434+ interfaces on the host, hence not requiring any capabilities or
3535+ privileges.
3636+ '';
3737+ license = lib.licenses.gpl2Plus;
3838+ platforms = platforms.linux;
3939+ maintainers = with maintainers; [ _8aed ];
4040+ };
4141+}