added custom package dir
This commit is contained in:
parent
58b4c7f52e
commit
bb5f5a242d
3 changed files with 95 additions and 1 deletions
|
|
@ -5,7 +5,7 @@ in
|
||||||
{
|
{
|
||||||
nixpkgs.config.packageOverrides = pkgs:
|
nixpkgs.config.packageOverrides = pkgs:
|
||||||
{
|
{
|
||||||
ombi = pkgs.callPackage /root/ombi {};
|
ombi = pkgs.callPackage ../packages/ombi {};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.ombi.enable = true;
|
services.ombi.enable = true;
|
||||||
|
|
|
||||||
55
packages/ombi/default.nix
Normal file
55
packages/ombi/default.nix
Normal file
|
|
@ -0,0 +1,55 @@
|
||||||
|
{ 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 = {
|
||||||
|
x64-linux_hash = "07zgmylrms4b0wpsxrcw5lkbk3sd4g97naks3wxsg4zb8r7lspzf";
|
||||||
|
arm64-linux_hash = "0xp27x0dy7c89b33vsvdyqdqn329xrgdkfh1jb6616xqajj459ah";
|
||||||
|
x64-osx_hash = "1di0npjxr0zpixk0yzms0v7han2xsinqm9lma253011kq2gbhjy5";
|
||||||
|
}."${arch}-${os}_hash";
|
||||||
|
|
||||||
|
in stdenv.mkDerivation rec {
|
||||||
|
pname = "ombi";
|
||||||
|
version = "4.22.5";
|
||||||
|
|
||||||
|
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" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
39
packages/ombi/update.sh
Executable file
39
packages/ombi/update.sh
Executable file
|
|
@ -0,0 +1,39 @@
|
||||||
|
#!/usr/bin/env nix-shell
|
||||||
|
#!nix-shell -i bash -p curl gnused nix-prefetch jq
|
||||||
|
|
||||||
|
dirname="$(dirname "$0")"
|
||||||
|
|
||||||
|
updateHash()
|
||||||
|
{
|
||||||
|
version=$1
|
||||||
|
arch=$2
|
||||||
|
os=$3
|
||||||
|
|
||||||
|
hashKey="${arch}-${os}_hash"
|
||||||
|
url="https://github.com/Ombi-app/Ombi/releases/download/v$version/$os-$arch.tar.gz"
|
||||||
|
hash="$(nix-prefetch-url $url)"
|
||||||
|
|
||||||
|
sed -i "s|$hashKey = \"[a-zA-Z0-9\/+-=]*\";|$hashKey = \"$hash\";|g" "$dirname/default.nix"
|
||||||
|
}
|
||||||
|
|
||||||
|
updateVersion()
|
||||||
|
{
|
||||||
|
sed -i "s/version = \"[0-9.]*\";/version = \"$1\";/g" "$dirname/default.nix"
|
||||||
|
}
|
||||||
|
|
||||||
|
oldversion="$(grep -Po '(?<=version = ").*(?=";)' default.nix)"
|
||||||
|
echo "$oldversion"
|
||||||
|
newversion="$(curl -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/Ombi-App/Ombi/releases | jq -r ".[0].tag_name" | sed "s/^v//")"
|
||||||
|
echo "$newversion"
|
||||||
|
version="$newversion"
|
||||||
|
|
||||||
|
if [[ "$oldversion" == "$newversion" ]]; then
|
||||||
|
echo "Ombi is up 2 date: Version $oldversion"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
updateVersion $newversion
|
||||||
|
|
||||||
|
updateHash $newversion x64 linux
|
||||||
|
updateHash $newversion arm64 linux
|
||||||
|
updateHash $newversion x64 osx
|
||||||
Loading…
Add table
Reference in a new issue