tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
lidarr: 0.8.1.2135 -> 1.0.2.2592
J2ghz
3 years ago
aa5e70ec
a7a5b8d5
+74
-15
2 changed files
expand all
collapse all
unified
split
pkgs
servers
lidarr
default.nix
update.sh
+32
-15
pkgs/servers/lidarr/default.nix
···
1
-
{ lib, stdenv, fetchurl, mono, libmediainfo, sqlite, curl, chromaprint, makeWrapper }:
2
3
-
stdenv.mkDerivation rec {
0
0
0
0
0
0
0
0
0
0
0
0
4
pname = "lidarr";
5
-
version = "0.8.1.2135";
6
7
src = fetchurl {
8
-
url = "https://github.com/lidarr/Lidarr/releases/download/v${version}/Lidarr.master.${version}.linux.tar.gz";
9
-
sha256 = "sha256-eJX6t19D2slX68fXSMd/Vix3XSgCVylK+Wd8VH9jsuI=";
10
};
11
12
nativeBuildInputs = [ makeWrapper ];
13
14
installPhase = ''
15
-
mkdir -p $out/bin
16
-
cp -r * $out/bin/
17
18
-
# Mark main executable as executable
19
-
chmod +x $out/bin/Lidarr.exe
0
0
0
0
20
21
-
makeWrapper "${mono}/bin/mono" $out/bin/Lidarr \
22
-
--add-flags "$out/bin/Lidarr.exe" \
23
-
--prefix PATH : ${lib.makeBinPath [ chromaprint ]} \
24
-
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [
25
-
curl sqlite libmediainfo ]}
26
'';
27
0
0
0
0
0
0
28
meta = with lib; {
29
description = "A Usenet/BitTorrent music downloader";
30
homepage = "https://lidarr.audio/";
31
license = licenses.gpl3;
32
maintainers = [ maintainers.etu ];
33
-
platforms = platforms.all;
34
};
35
}
···
1
+
{ lib, stdenv, fetchurl, mono, libmediainfo, sqlite, curl, chromaprint, makeWrapper, icu, dotnet-runtime, openssl, nixosTests }:
2
3
+
let
4
+
os = if stdenv.isDarwin then "osx" else "linux";
5
+
arch = {
6
+
x86_64-linux = "x64";
7
+
aarch64-linux = "arm64";
8
+
x86_64-darwin = "x64";
9
+
}."${stdenv.hostPlatform.system}" or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
10
+
hash = {
11
+
x64-linux_hash = "sha256-iuI24gT7/RFZ9xc4csd+zWEzPSPsxqYY5F+78IWRjxQ=";
12
+
arm64-linux_hash = "sha256-yHAoZxLeKF6mlR/Av0EH0Lh2XquM9Vx6huNDTEs4wyU=";
13
+
x64-osx_hash = "sha256-ES6njZTSfd/36+RvibE1hlQlCT+hEEcOem8epBSsnXc=";
14
+
}."${arch}-${os}_hash";
15
+
in stdenv.mkDerivation rec {
16
pname = "lidarr";
17
+
version = "1.0.2.2592";
18
19
src = fetchurl {
20
+
url = "https://github.com/lidarr/Lidarr/releases/download/v${version}/Lidarr.master.${version}.${os}-core-${arch}.tar.gz";
21
+
sha256 = hash;
22
};
23
24
nativeBuildInputs = [ makeWrapper ];
25
26
installPhase = ''
27
+
runHook preInstall
0
28
29
+
mkdir -p $out/{bin,share/${pname}-${version}}
30
+
cp -r * $out/share/${pname}-${version}/.
31
+
makeWrapper "${dotnet-runtime}/bin/dotnet" $out/bin/Lidarr \
32
+
--add-flags "$out/share/${pname}-${version}/Lidarr.dll" \
33
+
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [
34
+
curl sqlite libmediainfo icu openssl ]}
35
36
+
runHook postInstall
0
0
0
0
37
'';
38
39
+
40
+
passthru = {
41
+
updateScript = ./update.sh;
42
+
tests.smoke-test = nixosTests.lidarr;
43
+
};
44
+
45
meta = with lib; {
46
description = "A Usenet/BitTorrent music downloader";
47
homepage = "https://lidarr.audio/";
48
license = licenses.gpl3;
49
maintainers = [ maintainers.etu ];
50
+
platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ];
51
};
52
}
+42
pkgs/servers/lidarr/update.sh
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
#!/usr/bin/env nix-shell
2
+
#!nix-shell -i bash -p curl gnused nix-prefetch jq
3
+
4
+
set -e
5
+
6
+
dirname="$(dirname "$0")"
7
+
8
+
updateHash()
9
+
{
10
+
version=$1
11
+
arch=$2
12
+
os=$3
13
+
14
+
hashKey="${arch}-${os}_hash"
15
+
16
+
url="https://github.com/Lidarr/Lidarr/releases/download/v$version/Lidarr.master.$version.$os-core-$arch.tar.gz"
17
+
hash=$(nix-prefetch-url --type sha256 $url)
18
+
sriHash="$(nix hash to-sri --type sha256 $hash)"
19
+
20
+
sed -i "s|$hashKey = \"[a-zA-Z0-9\/+-=]*\";|$hashKey = \"$sriHash\";|g" "$dirname/default.nix"
21
+
}
22
+
23
+
updateVersion()
24
+
{
25
+
sed -i "s/version = \"[0-9.]*\";/version = \"$1\";/g" "$dirname/default.nix"
26
+
}
27
+
28
+
currentVersion=$(cd $dirname && nix eval --raw -f ../../.. radarr.version)
29
+
30
+
latestTag=$(curl https://api.github.com/repos/Lidarr/Lidarr/releases/latest | jq -r ".tag_name")
31
+
latestVersion="$(expr $latestTag : 'v\(.*\)')"
32
+
33
+
if [[ "$currentVersion" == "$latestVersion" ]]; then
34
+
echo "Lidarr is up-to-date: ${currentVersion}"
35
+
exit 0
36
+
fi
37
+
38
+
updateVersion $latestVersion
39
+
40
+
updateHash $latestVersion x64 linux
41
+
updateHash $latestVersion arm64 linux
42
+
updateHash $latestVersion x64 osx