@@ -0,0 +1,41 @@
1+{ lib
2+, fetchurl
3+, installShellFiles
4+, libsodium
5+, pkg-config
6+, protobuf
7+, rustPlatform
8+}:
9+
10+rustPlatform.buildRustPackage rec {
11+ pname = "ratman";
12+ version = "0.3.1";
13+
14+ src = fetchurl {
15+ url = "https://git.irde.st/we/irdest/-/archive/${pname}-${version}/irdest-${pname}-${version}.tar.gz";
16+ sha256 = "0x1wvhsmf7m55j9hmirkz75qivsg33xab1sil6nbv8fby428fpq6";
17+ };
18+
19+ cargoSha256 = "1dkfyy1z34qaavyd3f20hrrrb3kjsdfkyzd535xlds9wivgchmd0";
20+
21+ nativeBuildInputs = [ protobuf pkg-config installShellFiles ];
22+
23+ cargoBuildFlags = [ "--all-features" "-p" "ratman" ];
24+ cargoTestFlags = cargoBuildFlags;
25+
26+ buildInputs = [ libsodium ];
27+
28+ postInstall = ''
29+ installManPage docs/man/ratmand.1
30+ '';
31+
32+ SODIUM_USE_PKG_CONFIG = 1;
33+
34+ meta = with lib; {
35+ description = "A modular decentralised peer-to-peer packet router and associated tools";
36+ homepage = "https://git.irde.st/we/irdest";
37+ platforms = platforms.unix;
38+ license = licenses.agpl3;
39+ maintainers = with maintainers; [ spacekookie yuka ];
40+ };
41+}