1 { lib, stdenv, fetchurl, libmediainfo, sqlite, curl, makeWrapper, icu, dotnet-runtime, openssl, nixosTests }:
4 os = if stdenv.isDarwin then "osx" else "linux";
7 aarch64-linux = "arm64";
9 }."${stdenv.hostPlatform.system}" or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
11 x64-linux_hash = "sha256-heduuPx0lnbkB1c4tgbDO9wsGnyAzTPyW0ZEvYFwjd0=";
12 arm64-linux_hash = "sha256-vfy0pVIacnf0lW1VwUolbE/P+aBB9uQsm3enhGkjgXg=";
13 x64-osx_hash = "sha256-JW+9PRW1Wu+wu+QPh7INXkq87oRSuoOqNEqj0P2Stto=";
14 }."${arch}-${os}_hash";
15 in stdenv.mkDerivation rec {
17 version = "0.3.23.2506";
20 url = "https://github.com/Readarr/Readarr/releases/download/v${version}/Readarr.develop.${version}.${os}-core-${arch}.tar.gz";
24 nativeBuildInputs = [ makeWrapper ];
29 mkdir -p $out/{bin,share/${pname}-${version}}
30 cp -r * $out/share/${pname}-${version}/.
31 makeWrapper "${dotnet-runtime}/bin/dotnet" $out/bin/Readarr \
32 --add-flags "$out/share/${pname}-${version}/Readarr.dll" \
33 --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ curl sqlite libmediainfo icu openssl ]}
40 updateScript = ./update.sh;
41 tests.smoke-test = nixosTests.readarr;
45 description = "A Usenet/BitTorrent ebook downloader";
46 homepage = "https://readarr.com";
47 license = licenses.gpl3;
48 maintainers = [ maintainers.jocelynthode ];
49 mainProgram = "Readarr";
50 sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
51 platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ];