nixpkgs/pkgs/servers/misc/navidrome/default.nix

50 lines
1.3 KiB
Nix
Raw Normal View History

2021-10-22 23:02:26 +02:00
{ lib, stdenv, fetchurl, ffmpeg, ffmpegSupport ? true, makeWrapper, nixosTests }:
2020-06-20 15:08:46 +02:00
2021-01-15 08:07:56 +01:00
with lib;
2020-06-20 15:08:46 +02:00
stdenv.mkDerivation rec {
pname = "navidrome";
version = "0.45.1";
2020-06-20 15:08:46 +02:00
2021-10-22 23:02:26 +02:00
src = fetchurl (if stdenv.hostPlatform.system == "x86_64-linux"
then {
2020-06-20 15:08:46 +02:00
url = "https://github.com/deluan/navidrome/releases/download/v${version}/navidrome_${version}_Linux_x86_64.tar.gz";
sha256 = "sha256-TZcXq51sKoeLPmcRpv4VILDmS6dsS7lxlJzTDH0tEWM=";
}
else {
url = "https://github.com/deluan/navidrome/releases/download/v${version}/navidrome_${version}_Linux_arm64.tar.gz";
sha256 = "sha256-Va0DSmemj8hsaywoP6WKo/x+QQzSNwHCpU4VWs5lpbI=";
});
2020-06-20 15:08:46 +02:00
nativeBuildInputs = [ makeWrapper ];
unpackPhase = ''
tar xvf $src navidrome
2020-06-20 15:08:46 +02:00
'';
installPhase = ''
2021-05-08 02:38:47 +02:00
runHook preInstall
2020-06-20 15:08:46 +02:00
mkdir -p $out/bin
cp navidrome $out/bin
2021-05-08 02:38:47 +02:00
runHook postInstall
2020-06-20 15:08:46 +02:00
'';
postFixup = ''
wrapProgram $out/bin/navidrome \
--prefix PATH : ${makeBinPath (optional ffmpegSupport ffmpeg)}
'';
2020-11-22 23:44:46 +01:00
passthru.tests.navidrome = nixosTests.navidrome;
2020-06-20 15:08:46 +02:00
meta = {
description = "Navidrome Music Server and Streamer compatible with Subsonic/Airsonic";
homepage = "https://www.navidrome.org/";
2021-05-08 02:38:47 +02:00
license = licenses.gpl3Only;
platforms = [ "x86_64-linux" "aarch64-linux" ];
2020-06-20 15:08:46 +02:00
maintainers = with maintainers; [ aciceri ];
};
}