nixos/fileSystems: link to mount(8) from fileSystems.*.options (#377170)
[NixPkgs.git] / pkgs / by-name / rq / rqbit / package.nix
blobf5205818e20a5c42b57bf3b856c1cc4b6dec2884
2   lib,
3   stdenv,
4   rustPlatform,
5   fetchFromGitHub,
6   pkg-config,
7   openssl,
8   buildNpmPackage,
9   nodejs_20,
10   nix-update-script,
12 let
13   pname = "rqbit";
15   version = "8.0.0";
17   src = fetchFromGitHub {
18     owner = "ikatson";
19     repo = "rqbit";
20     rev = "v${version}";
21     hash = "sha256-Meztr/UxLgnbd3YwkSW0vy+D2N4mFg2v+T4nBnYiQBI=";
22   };
24   rqbit-webui = buildNpmPackage {
25     pname = "rqbit-webui";
27     nodejs = nodejs_20;
29     inherit version src;
31     sourceRoot = "${src.name}/crates/librqbit/webui";
33     npmDepsHash = "sha256-vib8jpf7Jn1qv0m/dWJ4TbisByczNbtEd8hIM5ll2Q8=";
35     installPhase = ''
36       runHook preInstall
38       mkdir -p $out/dist
39       cp -r dist/** $out/dist
41       runHook postInstall
42     '';
43   };
45 rustPlatform.buildRustPackage {
46   inherit pname version src;
48   useFetchCargoVendor = true;
49   cargoHash = "sha256-FGcws80cX0I74bVaSV6OLntPFPNanGAFm6CVHDAGbOU=";
51   nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ];
53   buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ openssl ];
55   preConfigure = ''
56     mkdir -p crates/librqbit/webui/dist
57     cp -R ${rqbit-webui}/dist/** crates/librqbit/webui/dist
58   '';
60   postPatch = ''
61     # This script fascilitates the build of the webui,
62     #  we've already built that
63     rm crates/librqbit/build.rs
64   '';
66   doCheck = false;
68   passthru.webui = rqbit-webui;
70   passthru.updateScript = nix-update-script {
71     extraArgs = [
72       "--subpackage"
73       "webui"
74     ];
75   };
77   meta = with lib; {
78     description = "Bittorrent client in Rust";
79     homepage = "https://github.com/ikatson/rqbit";
80     changelog = "https://github.com/ikatson/rqbit/releases/tag/v${version}";
81     license = licenses.asl20;
82     maintainers = with maintainers; [
83       cafkafk
84       toasteruwu
85     ];
86     mainProgram = "rqbit";
87   };