2021-10-13 10:48:53 +02:00
|
|
|
{ lib, stdenv, pkgs, fetchurl, ffmpeg, ffmpegSupport ? true, makeWrapper, nixosTests }:
|
2021-08-29 23:00:06 +02:00
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-10-13 10:48:53 +02:00
|
|
|
pname = "navidrome-bin";
|
|
|
|
version = "0.46.0";
|
2021-08-29 23:00:06 +02:00
|
|
|
|
2021-10-13 10:48:53 +02:00
|
|
|
|
|
|
|
src = fetchurl (if pkgs.system == "x86_64-linux"
|
|
|
|
then {
|
|
|
|
url = "https://github.com/navidrome/navidrome/releases/download/v${version}/navidrome_${version}_Linux_x86_64.tar.gz";
|
|
|
|
sha256 = "sha256-baBSQZnlcC5zq7wKWbia8xEMqZuCgkn/zyQWwtfHn/w=";
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
url = "https://github.com/navidrome/navidrome/releases/download/v${version}/navidrome_${version}_Linux_arm64.tar.gz";
|
|
|
|
sha256 = "sha256-Km58BMc2ngv6CLqXkNpDIxC+nFb/fbvz7iBF0/xNcsU=";
|
|
|
|
});
|
2021-08-29 23:00:06 +02:00
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
unpackPhase = ''
|
2021-10-13 10:48:53 +02:00
|
|
|
tar xvf $src navidrome
|
2021-08-29 23:00:06 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp navidrome $out/bin
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
wrapProgram $out/bin/navidrome \
|
|
|
|
--prefix PATH : ${makeBinPath (optional ffmpegSupport ffmpeg)}
|
|
|
|
'';
|
|
|
|
|
2021-10-13 10:48:53 +02:00
|
|
|
passthru.tests.navidrome = nixosTests.navidrome;
|
|
|
|
|
2021-08-29 23:00:06 +02:00
|
|
|
meta = {
|
|
|
|
description = "Navidrome Music Server and Streamer compatible with Subsonic/Airsonic";
|
|
|
|
homepage = "https://www.navidrome.org/";
|
|
|
|
license = licenses.gpl3Only;
|
2021-10-13 10:48:53 +02:00
|
|
|
platforms = [ "x86_64-linux" "aarch64-linux" ];
|
2021-08-29 23:00:06 +02:00
|
|
|
maintainers = with maintainers; [ aciceri ];
|
|
|
|
};
|
|
|
|
}
|