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 = {
x64-linux_hash = "sha256-9YNhyhxnnn2CesXLJH5Cs7yB9w23YUAZPrk9vEHvevk=";
arm64-linux_hash = "sha256-RBCyfozmBpWrmsfMcdb1BqcBXj64CMDrgpMZTzj85ZQ=";
x64-osx_hash = "sha256-+AKENBZohBUEKQEM3L69EzC84MhCX3fGvsNFn5p2v84=";
arm64-osx_hash = "sha256-Arx8usecAN+d0NGL7Hv+rB4GG7p/KLAaqpJFgNg7C2Y=";
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";
version = "4.0.1.929";
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
};
}