2021-10-28 06:52:43 +00:00
|
|
|
{ lib, stdenv, fetchurl, ffmpeg, ffmpegSupport ? true, makeWrapper, nixosTests }:
|
2020-06-15 15:56:04 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
with lib;
|
2020-06-15 15:56:04 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "navidrome";
|
2022-02-10 20:34:41 +00:00
|
|
|
version = "0.47.5";
|
2020-06-15 15:56:04 +00:00
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
src = fetchurl (if stdenv.hostPlatform.system == "x86_64-linux"
|
2021-09-18 10:52:07 +00:00
|
|
|
then {
|
2020-06-15 15:56:04 +00:00
|
|
|
url = "https://github.com/deluan/navidrome/releases/download/v${version}/navidrome_${version}_Linux_x86_64.tar.gz";
|
2022-02-10 20:34:41 +00:00
|
|
|
sha256 = "sha256-AkSjtln53HDdIcQgnA8Wj010RXnOlOsFm2wfVgbvwtc=";
|
2021-09-18 10:52:07 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
url = "https://github.com/deluan/navidrome/releases/download/v${version}/navidrome_${version}_Linux_arm64.tar.gz";
|
2022-02-10 20:34:41 +00:00
|
|
|
sha256 = "sha256-+VBRiV2zKa6PwamWj/jmE4iuoohAD6oeGnlFi4/01HM=";
|
2021-09-18 10:52:07 +00:00
|
|
|
});
|
2020-06-15 15:56:04 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
unpackPhase = ''
|
2021-09-18 10:52:07 +00:00
|
|
|
tar xvf $src navidrome
|
2020-06-15 15:56:04 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-05-20 23:08:51 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-06-15 15:56:04 +00:00
|
|
|
mkdir -p $out/bin
|
|
|
|
cp navidrome $out/bin
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-06-15 15:56:04 +00:00
|
|
|
'';
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
postFixup = optionalString ffmpegSupport ''
|
2020-06-15 15:56:04 +00:00
|
|
|
wrapProgram $out/bin/navidrome \
|
2022-05-18 14:49:53 +00:00
|
|
|
--prefix PATH : ${makeBinPath [ ffmpeg ]}
|
2020-06-15 15:56:04 +00:00
|
|
|
'';
|
2020-11-24 20:58:05 +00:00
|
|
|
|
2021-08-18 13:19:15 +00:00
|
|
|
passthru.tests.navidrome = nixosTests.navidrome;
|
|
|
|
|
2020-06-15 15:56:04 +00:00
|
|
|
meta = {
|
|
|
|
description = "Navidrome Music Server and Streamer compatible with Subsonic/Airsonic";
|
|
|
|
homepage = "https://www.navidrome.org/";
|
2021-05-20 23:08:51 +00:00
|
|
|
license = licenses.gpl3Only;
|
2021-09-18 10:52:07 +00:00
|
|
|
platforms = [ "x86_64-linux" "aarch64-linux" ];
|
2020-06-15 15:56:04 +00:00
|
|
|
maintainers = with maintainers; [ aciceri ];
|
|
|
|
};
|
|
|
|
}
|