nixpkgs/pkgs/servers/prowlarr/default.nix
Martin Weinelt 7b5e4989ad
prowlarr: 1.2.0.2583 -> 1.2.2.2699
https://github.com/Prowlarr/Prowlarr/releases/tag/v1.2.2.2699

This update adds support for aarch64-darwin systems.

Refactors the url download logic by relying strictly on the system
identifier and using a unified throw that is more informative.

Also prowlarr now seems to be doing releases on the master branch,
instead of develop. I updated the update script accordingly.
2023-02-21 00:15:16 +01:00

74 lines
2.1 KiB
Nix

{ lib, stdenv, fetchurl, mono, libmediainfo, sqlite, curl, makeWrapper, icu, dotnet-runtime, openssl, nixosTests, zlib }:
let
pname = "prowlarr";
unsupported = throw "Unsupported system ${stdenv.hostPlatform.system} for ${pname}";
os =
if stdenv.isDarwin then
"osx"
else if stdenv.isLinux then
"linux"
else
unsupported;
arch = {
aarch64-darwin = "arm64";
aarch64-linux = "arm64";
x86_64-darwin = "x64";
x86_64-linux = "x64";
}.${stdenv.hostPlatform.system} or unsupported;
hash = {
aarch64-darwin = "sha256-S9CrYDCwIssAtcP4pI1csbOOFKaZgM6UKEDNBp2VwVo=";
aarch64-linux = "sha256-UkoTWD4ljSfx/FzH5kQBpp/Bg+xwvc7n9KLBrqNNSR0=";
x86_64-darwin = "sha256-Wru+pwISVgjnSVe8HbiwU4M1aIIK5AGzml/2yqMGIlo=";
x86_64-linux = "sha256-eJRJ1LvQsmlMeWoUmGrAyLfoebG8g/Kl2lBQxMjIyTY=";
}.${stdenv.hostPlatform.system} or unsupported;
in stdenv.mkDerivation rec {
inherit pname;
version = "1.2.2.2699";
src = fetchurl {
url = "https://github.com/Prowlarr/Prowlarr/releases/download/v${version}/Prowlarr.master.${version}.${os}-core-${arch}.tar.gz";
inherit hash;
};
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/{bin,share/${pname}-${version}}
cp -r * $out/share/${pname}-${version}/.
makeWrapper "${dotnet-runtime}/bin/dotnet" $out/bin/Prowlarr \
--add-flags "$out/share/${pname}-${version}/Prowlarr.dll" \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [
curl sqlite libmediainfo mono openssl icu zlib ]}
runHook postInstall
'';
passthru = {
updateScript = ./update.sh;
tests.smoke-test = nixosTests.prowlarr;
};
meta = with lib; {
description = "An indexer manager/proxy built on the popular arr .net/reactjs base stack";
homepage = "https://wiki.servarr.com/prowlarr";
changelog = "https://github.com/Prowlarr/Prowlarr/releases/tag/v${version}";
license = licenses.gpl3Only;
maintainers = with maintainers; [ jdreaver ];
platforms = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
};
}