nixpkgs/pkgs/servers/ombi/default.nix

56 lines
1.8 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, makeWrapper, autoPatchelfHook, fixDarwinDylibNames, zlib, krb5, openssl, icu, nixosTests }:
2021-03-29 16:46:01 +02:00
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 = {
2021-08-26 12:38:27 +02:00
x64-linux_hash = "sha256-4kvcBRMMH4AnTKSES5Cpst/omTRXVRq1V1y/z5njKJI=";
arm64-linux_hash = "sha256-NLsf0ldvlKSrHJyAXv5Ar2zIetoga6iZPOGTxFOqoQQ=";
x64-osx_hash = "sha256-tjvGuShz/fv3qUknFVKJ+tE/bVtIyPZ7dr4JfTEcDJY=";
2021-03-29 16:46:01 +02:00
}."${arch}-${os}_hash";
in stdenv.mkDerivation rec {
pname = "ombi";
2021-08-26 12:38:27 +02:00
version = "4.0.1468";
2021-03-29 16:46:01 +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 ];
2021-03-29 16:46:01 +02:00
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 ]} \
2021-03-29 16:46:01 +02:00
--run "cd $out/share/${pname}-${version}"
'';
passthru = {
updateScript = ./update.sh;
2021-03-29 16:51:53 +02:00
tests.smoke-test = nixosTests.ombi;
2021-03-29 16:46:01 +02:00
};
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" ];
};
}