From 8b89e2b819ef66f4faaf1c1b2550e714e1dc5dad Mon Sep 17 00:00:00 2001 From: Mostly Void Date: Tue, 29 Nov 2022 05:57:08 +0530 Subject: [PATCH] motrix: init at 1.6.11 (#185804) Co-authored-by: Sandro Co-authored-by: zendo Resolves https://github.com/NixOS/nixpkgs/issues/157984 --- pkgs/tools/networking/motrix/default.nix | 36 ++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 pkgs/tools/networking/motrix/default.nix diff --git a/pkgs/tools/networking/motrix/default.nix b/pkgs/tools/networking/motrix/default.nix new file mode 100644 index 000000000000..2c6450b67554 --- /dev/null +++ b/pkgs/tools/networking/motrix/default.nix @@ -0,0 +1,36 @@ +{ lib +, appimageTools +, fetchurl +}: +let + pname = "motrix"; + version = "1.6.11"; + + src = fetchurl { + url = "https://github.com/agalwood/Motrix/releases/download/v${version}/Motrix-${version}.AppImage"; + sha256 = "sha256-tE2Q7NM+cQOg+vyqyfRwg05EOMQWhhggTA6S+VT+SkM="; + }; + + appimageContents = appimageTools.extractType2 { + inherit pname version src; + }; +in +appimageTools.wrapType2 rec { + inherit pname version src; + + extraInstallCommands = '' + mv $out/bin/${pname}-${version} $out/bin/${pname} + install -m 444 -D ${appimageContents}/${pname}.desktop -t $out/share/applications + cp -r ${appimageContents}/usr/share/icons $out/share + substituteInPlace $out/share/applications/${pname}.desktop \ + --replace 'Exec=AppRun' 'Exec=${pname}' + ''; + + meta = with lib; { + description = "A full-featured download manager"; + homepage = "https://motrix.app"; + license = licenses.mit; + platforms = [ "x86_64-linux" ]; + maintainers = with maintainers; [ dit7ya ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 66ba36676035..a4651d305032 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9412,6 +9412,8 @@ with pkgs; mosh = callPackage ../tools/networking/mosh { }; + motrix = callPackage ../tools/networking/motrix { }; + mpage = callPackage ../tools/text/mpage { }; mprime = callPackage ../tools/misc/mprime { };