From 36cee8e9e59e7990a014a7c16a4e45d498856332 Mon Sep 17 00:00:00 2001
From: Mario Rodas <marsam@users.noreply.github.com>
Date: Fri, 22 Oct 2021 21:50:03 -0500
Subject: [PATCH] rqbit: init at 2.0.0

---
 .../networking/p2p/rqbit/default.nix          | 29 +++++++++++++++++++
 pkgs/top-level/all-packages.nix               |  4 +++
 2 files changed, 33 insertions(+)
 create mode 100644 pkgs/applications/networking/p2p/rqbit/default.nix

diff --git a/pkgs/applications/networking/p2p/rqbit/default.nix b/pkgs/applications/networking/p2p/rqbit/default.nix
new file mode 100644
index 000000000000..0a77a64916e1
--- /dev/null
+++ b/pkgs/applications/networking/p2p/rqbit/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, rustPlatform, fetchFromGitHub, pkg-config, openssl, Security }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "rqbit";
+  version = "2.1.0";
+
+  src = fetchFromGitHub {
+    owner = "ikatson";
+    repo = "rqbit";
+    rev = "v${version}";
+    sha256 = "1dyf1sjfiwrrigk1186mzvx5vn196h45imvily394ky2di633av5";
+  };
+
+  cargoSha256 = "02z5gdmir1x80axnv516hs00478c7zbb30rdsbs966yh1725w12z";
+
+  nativeBuildInputs = lib.optionals stdenv.isLinux [ pkg-config ];
+
+  buildInputs = lib.optionals stdenv.isLinux [ openssl ]
+    ++ lib.optionals stdenv.isDarwin [ Security ];
+
+  doCheck = false;
+
+  meta = with lib; {
+    description = "A bittorrent client in Rust";
+    homepage = "https://github.com/ikatson/rqbit";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ marsam ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 2cfdcf014b2c..f9afb5664242 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -26795,6 +26795,10 @@ with pkgs;
 
   qemacs = callPackage ../applications/editors/qemacs { };
 
+  rqbit = callPackage ../applications/networking/p2p/rqbit {
+    inherit (darwin.apple_sdk.frameworks) Security;
+  };
+
   rssguard = libsForQt5.callPackage ../applications/networking/feedreaders/rssguard { };
 
   scudcloud = callPackage ../applications/networking/instant-messengers/scudcloud { };