Skip to content

Commit 8c676bb

Browse files
committed
jellystat: init at 1.1.11
1 parent e4f0986 commit 8c676bb

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
lib,
3+
buildNpmPackage,
4+
fetchFromGitHub,
5+
makeWrapper,
6+
nodejs_22,
7+
}:
8+
buildNpmPackage (finalAttrs: {
9+
pname = "jellystat";
10+
version = "1.1.11";
11+
12+
__structuredAttrs = true;
13+
14+
src = fetchFromGitHub {
15+
owner = "CyferShepard";
16+
repo = "Jellystat";
17+
tag = finalAttrs.version;
18+
hash = "sha256-HuLSXhj90fPfxv5qyCVCY67w07WwTBGp220iG9dGZyk=";
19+
};
20+
21+
npmDepsFetcherVersion = 2;
22+
23+
npmDepsHash = "sha256-yfcrBLbD11x3Siqv670jw8A3K11DrwnBj0VSC64JBP0=";
24+
25+
makeCacheWritable = true;
26+
27+
nodejs = nodejs_22;
28+
29+
npmPackFlags = [ "--ignore-scripts" ];
30+
npmFlags = [ "--legacy-peer-deps" ];
31+
32+
env.NODE_OPTIONS = "--openssl-legacy-provider";
33+
34+
postPatch = ''
35+
substituteInPlace backend/server.js \
36+
--replace-fail "const PORT = 3000;" "const PORT = Number(process.env.JS_PORT || 3000);"
37+
'';
38+
39+
nativeBuildInputs = [ makeWrapper ];
40+
41+
installPhase = ''
42+
runHook preInstall
43+
44+
mkdir -p $out/share/jellystat $out/bin
45+
cp -r . $out/share/jellystat/
46+
47+
makeWrapper ${nodejs_22}/bin/node $out/bin/jellystat \
48+
--chdir $out/share/jellystat \
49+
--add-flags $out/share/jellystat/backend/server.js
50+
51+
runHook postInstall
52+
'';
53+
54+
meta = with lib; {
55+
description = "Jellystat is a free and open source Statistics App for Jellyfin";
56+
homepage = "https://github.com/CyferShepard/Jellystat";
57+
license = licenses.mit;
58+
maintainers = with maintainers; [ mistyttm ];
59+
mainProgram = "jellystat";
60+
platforms = platforms.linux;
61+
};
62+
})

0 commit comments

Comments
 (0)