nixpkgs/pkgs/servers/ombi/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 lines
1.9 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, makeWrapper, autoPatchelfHook, fixDarwinDylibNames, zlib, krb5, openssl, icu, nixosTests }:
2021-03-29 14:46:01 +00: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 = {
2022-08-14 14:14:51 +00:00
x64-linux_hash = "sha256-7l9NT0brk6c7H3oqe9IjTY+5Ji2c5a4vB4vomqmv7x8=";
arm64-linux_hash = "sha256-UKVCpFS4m2DMkgG62V7uSQyLG/Zt6z3GSogd30A/4nY=";
x64-osx_hash = "sha256-xUu4nsAzBDCKUJWmim3UXVgFzwa6fg9mj/eD3OW1ILY=";
2021-03-29 14:46:01 +00:00
}."${arch}-${os}_hash";
in stdenv.mkDerivation rec {
pname = "ombi";
2022-08-14 14:14:51 +00:00
version = "4.22.5";
2021-03-29 14:46:01 +00:00
sourceRoot = ".";
src = fetchurl {
url = "https://github.com/Ombi-app/Ombi/releases/download/v${version}/${os}-${arch}.tar.gz";
sha256 = hash;
};
nativeBuildInputs = [ makeWrapper ]
++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook
++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
propagatedBuildInputs = [ stdenv.cc.cc zlib krb5 ];
2021-03-29 14:46:01 +00: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 ]} \
--chdir "$out/share/${pname}-${version}"
2021-03-29 14:46:01 +00:00
'';
passthru = {
updateScript = ./update.sh;
2021-03-29 14:51:53 +00:00
tests.smoke-test = nixosTests.ombi;
2021-03-29 14:46:01 +00: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/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
2021-03-29 14:46:01 +00:00
license = licenses.gpl2Only;
maintainers = with maintainers; [ woky ];
platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ];
};
}