jellyseerr

This commit is contained in:
Pim Kunis 2024-12-18 22:36:25 +01:00
parent 782b2e1c45
commit 52d73755bf
5 changed files with 122 additions and 73 deletions

View file

@ -0,0 +1,82 @@
{
lib,
pnpm_9,
fetchFromGitHub,
stdenv,
makeWrapper,
nodejs,
python3,
sqlite,
nix-update-script,
}:
stdenv.mkDerivation rec {
pname = "jellyseerr";
version = "2.1.0";
src = fetchFromGitHub {
owner = "Fallenbagel";
repo = "jellyseerr";
rev = "v${version}";
hash = "sha256-5kaeqhjUy9Lgx4/uFcGRlAo+ROEOdTWc2m49rq8R8Hs=";
};
pnpmDeps = pnpm_9.fetchDeps {
inherit pname version src;
hash = "sha256-xu6DeaBArQmnqEnIgjc1DTZujQebSkjuai9tMHeQWCk=";
};
buildInputs = [sqlite];
nativeBuildInputs = [
python3
nodejs
makeWrapper
pnpm_9.configHook
];
preBuild = ''
export npm_config_nodedir=${nodejs}
pushd node_modules
pnpm rebuild bcrypt sqlite3
popd
'';
buildPhase = ''
runHook preBuild
pnpm build
pnpm prune --prod --ignore-scripts
rm -rf .next/cache
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/share
cp -r -t $out/share .next node_modules dist config package.json overseerr-api.yml
runHook postInstall
'';
postInstall = ''
mkdir -p $out/bin
makeWrapper '${nodejs}/bin/node' "$out/bin/jellyseerr" \
--add-flags "$out/share/dist/index.js" \
--chdir "$out/share" \
--set NODE_ENV production
'';
passthru.updateScript = nix-update-script {};
meta = with lib; {
description = "Fork of overseerr for jellyfin support";
homepage = "https://github.com/Fallenbagel/jellyseerr";
longDescription = ''
Jellyseerr is a free and open source software application for managing
requests for your media library. It is a a fork of Overseerr built to
bring support for Jellyfin & Emby media servers!
'';
license = licenses.mit;
maintainers = with maintainers; [camillemndn];
platforms = platforms.linux;
mainProgram = "jellyseerr";
};
}

21
images/jellyseerr.nix Normal file
View file

@ -0,0 +1,21 @@
{
nglib,
nixpkgs,
...
}:
nglib.makeSystem {
inherit nixpkgs;
system = "x86_64-linux";
name = "nixng-jellyseerr";
config = {pkgs, ...}: {
dinit.enable = true;
init.services.jellyseerr.shutdownOnExit = true;
services.jellyseerr = {
enable = true;
package = pkgs.callPackage ./jellyseerr-2.1.0.nix {};
configDir = "/app/config";
};
};
}