···1+{ stdenv, lib, fetchgit }:
2+3+stdenv.mkDerivation {
4+ pname = "passt";
5+ version = "0.2023_11_10.5ec3634";
6+ src = fetchgit {
7+ url = "git://passt.top/passt";
8+ rev = "5ec3634b07215337c2e69d88f9b1d74711897d7d";
9+ hash = "sha256-76CD9PYD/NcBkmRYFSZaYl381QJjuWo0VsNdh31d6/M=";
10+ };
11+ nativeBuildInputs = [ ];
12+ buildInputs = [];
13+ installPhase = ''
14+ runHook preInstall
15+ mkdir -p $out/bin $out/share/man/man1
16+ cp passt pasta qrap $out/bin/
17+ cp passt.1 pasta.1 qrap.1 $out/share/man/man1/
18+ '' + (lib.optionalString stdenv.hostPlatform.avx2Support ''
19+ cp passt.avx2 pasta.avx2 $out/bin/
20+ runHook postInstall
21+ '');
22+ meta = with lib; {
23+ homepage = "https://passt.top/passt/about/";
24+ description = "Translation layer between a Layer-2 network interface and native Layer-4 sockets";
25+ longDescription = ''
26+ passt implements a translation layer between a Layer-2 network interface
27+ and native Layer-4 sockets (TCP, UDP, ICMP/ICMPv6 echo) on a host.
28+ It doesn't require any capabilities or privileges, and it can be used as
29+ a simple replacement for Slirp.
30+31+ pasta (same binary as passt, different command) offers equivalent
32+ functionality, for network namespaces: traffic is forwarded using a tap
33+ interface inside the namespace, without the need to create further
34+ interfaces on the host, hence not requiring any capabilities or
35+ privileges.
36+ '';
37+ license = lib.licenses.gpl2Plus;
38+ platforms = platforms.linux;
39+ maintainers = with maintainers; [ _8aed ];
40+ };
41+}