nixpkgs/pkgs/servers/sonarr/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 lines
1.8 KiB
Nix
Raw Normal View History

2024-01-01 11:45:58 +00:00
{ lib, stdenv, fetchurl, dotnet-runtime, icu, ffmpeg, openssl, sqlite, curl, makeWrapper, nixosTests }:
let
os = if stdenv.isDarwin then "osx" else "linux";
arch = {
x86_64-linux = "x64";
aarch64-linux = "arm64";
x86_64-darwin = "x64";
aarch64-darwin = "arm64";
}."${stdenv.hostPlatform.system}" or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
hash = {
2024-04-04 15:46:20 +00:00
x64-linux_hash = "sha256-xGaPNEPSpUr9sv4DTK8oDHzmLytp3Tp+cp45Q1TKYrc=";
arm64-linux_hash = "sha256-YeHXIyocRgaHmKrE9K9E3+xZyS2MDnsxmSIJB7dAQLU=";
x64-osx_hash = "sha256-8/YEKfSldXBtnkWBEXmCWYIJ2ePJj1aMDpBO3+cDcDk=";
arm64-osx_hash = "sha256-3aA8SlhNLOBAZIcsnjfl0ninsDej+KqTTwmm+rLYRFk=";
2024-01-01 11:45:58 +00:00
}."${arch}-${os}_hash";
in
2016-06-02 15:54:02 +00:00
stdenv.mkDerivation rec {
pname = "sonarr";
2024-04-04 15:46:20 +00:00
version = "4.0.3.1413";
2016-06-02 15:54:02 +00:00
src = fetchurl {
url = "https://github.com/Sonarr/Sonarr/releases/download/v${version}/Sonarr.main.${version}.${os}-${arch}.tar.gz";
2024-01-01 11:45:58 +00:00
inherit hash;
2016-06-02 15:54:02 +00:00
};
2019-10-22 15:40:13 +00:00
nativeBuildInputs = [ makeWrapper ];
2016-06-02 15:54:02 +00:00
installPhase = ''
2021-06-21 12:58:07 +00:00
runHook preInstall
2024-01-01 11:45:58 +00:00
mkdir -p $out/{bin,share/sonarr-${version}}
cp -r * $out/share/sonarr-${version}/.
makeWrapper "${dotnet-runtime}/bin/dotnet" $out/bin/NzbDrone \
--add-flags "$out/share/sonarr-${version}/Sonarr.dll" \
--prefix PATH : ${lib.makeBinPath [ ffmpeg ]} \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ curl sqlite openssl icu ]}
2021-06-21 12:58:07 +00:00
runHook postInstall
2016-06-02 15:54:02 +00:00
'';
passthru = {
2022-05-11 21:29:17 +00:00
updateScript = ./update.sh;
tests.smoke-test = nixosTests.sonarr;
};
2016-06-02 15:54:02 +00:00
meta = {
description = "Smart PVR for newsgroup and bittorrent users";
2020-03-20 14:06:19 +00:00
homepage = "https://sonarr.tv/";
license = lib.licenses.gpl3Only;
2021-01-15 07:07:56 +00:00
maintainers = with lib.maintainers; [ fadenb purcell ];
2023-11-09 14:33:04 +00:00
mainProgram = "NzbDrone";
2021-01-15 07:07:56 +00:00
platforms = lib.platforms.all;
2016-06-02 15:54:02 +00:00
};
}