2022-08-08 20:35:38 +02:00
|
|
|
{ lib, stdenv, fetchurl, makeWrapper, autoPatchelfHook, fixDarwinDylibNames, zlib, krb5, openssl, icu, nixosTests }:
|
|
|
|
|
|
|
|
|
|
let
|
|
|
|
|
os = if stdenv.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 = {
|
2022-09-08 06:12:30 +02:00
|
|
|
x64-linux_hash = "0rcrmav7gq0rx4152c4ah61pzjz37nq90in2ky1i6pvcmfh84ykk";
|
|
|
|
|
arm64-linux_hash = "1anan48hqx5afaaa2gck5pw1amjiliqyw1ps90sy8dg9rxyyczvj";
|
|
|
|
|
x64-osx_hash = "1whnz2z36zzz2jwlhj9ks7n57q1q5jgg1giq87cysn3k0w7s1n26";
|
2022-08-08 20:35:38 +02:00
|
|
|
}."${arch}-${os}_hash";
|
|
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
|
pname = "ombi";
|
2022-09-08 06:12:30 +02:00
|
|
|
version = "4.25.1";
|
2022-08-08 20:35:38 +02:00
|
|
|
|
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
|
url = "https://github.com/Ombi-app/Ombi/releases/download/v${version}/${os}-${arch}.tar.gz";
|
|
|
|
|
sha256 = hash;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper autoPatchelfHook ]
|
|
|
|
|
++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
|
|
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ stdenv.cc.cc zlib krb5 ];
|
|
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
|
mkdir -p $out/{bin,share/${pname}-${version}}
|
|
|
|
|
cp -r * $out/share/${pname}-${version}
|
|
|
|
|
|
|
|
|
|
makeWrapper $out/share/${pname}-${version}/Ombi $out/bin/Ombi \
|
|
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ openssl icu ]} \
|
|
|
|
|
--run "cd $out/share/${pname}-${version}"
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
|
updateScript = ./update.sh;
|
|
|
|
|
tests.smoke-test = nixosTests.ombi;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
|
description = "Self-hosted web application that automatically gives your shared Plex or Emby users the ability to request content by themselves";
|
|
|
|
|
homepage = "https://ombi.io/";
|
|
|
|
|
license = licenses.gpl2Only;
|
|
|
|
|
maintainers = with maintainers; [ woky ];
|
|
|
|
|
platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ];
|
|
|
|
|
};
|
|
|
|
|
}
|