Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jellyseerr: 1.9.2 -> 2.1.0 #360844

Merged
merged 4 commits into from
Jan 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions nixos/modules/services/misc/jellyseerr.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,28 @@ in
default = 5055;
description = ''The port which the Jellyseerr web UI should listen to.'';
};

configDir = lib.mkOption {
type = lib.types.path;
default = "/var/lib/jellyseerr/config";
description = "Config data directory";
};
};

config = lib.mkIf cfg.enable {
systemd.services.jellyseerr = {
description = "Jellyseerr, a requests manager for Jellyfin";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
environment.PORT = toString cfg.port;
environment = {
PORT = toString cfg.port;
CONFIG_DIRECTORY = cfg.configDir;
};
serviceConfig = {
Type = "exec";
StateDirectory = "jellyseerr";
WorkingDirectory = "${cfg.package}/libexec/jellyseerr/deps/jellyseerr";
DynamicUser = true;
ExecStart = lib.getExe cfg.package;
BindPaths = [ "/var/lib/jellyseerr/:${cfg.package}/libexec/jellyseerr/deps/jellyseerr/config/" ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use the CONFIG_DIRECTORY environmental variable to accomplish the same, so we don't have to make a bind mount. I'm doing that here as well.

Restart = "on-failure";
ProtectHome = true;
ProtectSystem = "strict";
Expand Down
87 changes: 87 additions & 0 deletions pkgs/by-name/je/jellyseerr/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
lib,
pnpm_9,
fetchFromGitHub,
stdenv,
makeWrapper,
nodejs_20,
python3,
sqlite,
nix-update-script,
}:

let
nodejs = nodejs_20;
pnpm = pnpm_9.override { inherit nodejs; };
in
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.fetchDeps {
inherit pname version src;
hash = "sha256-xu6DeaBArQmnqEnIgjc1DTZujQebSkjuai9tMHeQWCk=";
};

buildInputs = [ sqlite ];

nativeBuildInputs = [
python3
nodejs
makeWrapper
pnpm.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 public package.json overseerr-api.yml
runHook postInstall
'';

postInstall = ''
mkdir -p $out/bin
makeWrapper '${nodejs}/bin/node' "$out/bin/jellyseerr" \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of setting WorkingDirectory on the Systemd service, we could set --chdir in the wrapper script. That would have the benefit that the executable can be ran easily on the command line as well.

--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";
};
}
96 changes: 0 additions & 96 deletions pkgs/servers/jellyseerr/default.nix

This file was deleted.

Loading
Loading