push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,86 @@
{
lib,
stdenv,
fetchurl,
libmediainfo,
sqlite,
curl,
makeWrapper,
icu,
dotnet-runtime,
openssl,
nixosTests,
zlib,
}:
let
os = if stdenv.hostPlatform.isDarwin then "osx" else "linux";
arch =
{
x86_64-linux = "x64";
aarch64-linux = "arm64";
x86_64-darwin = "x64";
}
."${stdenv.hostPlatform.system}" or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
hash =
{
x64-linux_hash = "sha256-hCqxH6xPLhA+V7reqsHi1EY2sU3HJ6ESMJiiWXrcUUE=";
arm64-linux_hash = "sha256-7NpH32tkEOYVyfwIBq9LCKAo0IQ1IehYfKi+qiBzf8o=";
x64-osx_hash = "sha256-ypzOWXxtzvOTgTmU7pQ1cS+FcyNCOo5R2Z4l5Mk+4wA=";
}
."${arch}-${os}_hash";
in
stdenv.mkDerivation rec {
pname = "readarr";
version = "0.4.18.2805";
src = fetchurl {
url = "https://github.com/Readarr/Readarr/releases/download/v${version}/Readarr.develop.${version}.${os}-core-${arch}.tar.gz";
sha256 = hash;
};
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/{bin,share/${pname}-${version}}
cp -r * $out/share/${pname}-${version}/.
makeWrapper "${dotnet-runtime}/bin/dotnet" $out/bin/Readarr \
--add-flags "$out/share/${pname}-${version}/Readarr.dll" \
--prefix LD_LIBRARY_PATH : ${
lib.makeLibraryPath [
curl
sqlite
libmediainfo
icu
openssl
zlib
]
}
runHook postInstall
'';
passthru = {
updateScript = ./update.sh;
tests.smoke-test = nixosTests.readarr;
};
meta = {
description = "Usenet/BitTorrent ebook downloader";
homepage = "https://readarr.com";
license = lib.licenses.gpl3;
maintainers = with lib.maintainers; [
jocelynthode
devusb
];
mainProgram = "Readarr";
sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
platforms = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
];
};
}

View File

@@ -0,0 +1,44 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl gnused nix-prefetch jq
set -e
dirname="$(dirname "$0")"
updateHash()
{
version=$1
arch=$2
os=$3
hashKey="${arch}-${os}_hash"
url="https://github.com/Readarr/Readarr/releases/download/v$version/Readarr.develop.$version.$os-core-$arch.tar.gz"
hash=$(nix-prefetch-url --type sha256 $url)
sriHash="$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $hash)"
sed -i "s|$hashKey = \"[a-zA-Z0-9\/+-=]*\";|$hashKey = \"$sriHash\";|g" "$dirname/package.nix"
}
updateVersion()
{
sed -i "s/version = \"[0-9.]*\";/version = \"$1\";/g" "$dirname/package.nix"
}
currentVersion=$(cd $dirname && nix eval --raw -f ../../../.. readarr.version)
# We cannot use the latest releases as in the past Readarr released old version with v2.0 and then went back to 0.1
latestTag=$(curl https://api.github.com/repos/Readarr/Readarr/releases | jq -r ".[0].tag_name")
latestVersion="$(expr $latestTag : 'v\(.*\)')"
if [[ "$currentVersion" == "$latestVersion" ]]; then
echo "Readarr is up-to-date: ${currentVersion}"
exit 0
fi
updateVersion $latestVersion
updateHash $latestVersion x64 linux
updateHash $latestVersion arm64 linux
updateHash $latestVersion x64 osx