2021-04-24 12:43:32 +01:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkgs
|
|
|
|
, stdenv
|
|
|
|
, nodejs
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "jellyfin-web";
|
2022-03-28 09:48:01 +01:00
|
|
|
version = "10.8.0";
|
2021-04-24 12:43:32 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jellyfin";
|
|
|
|
repo = "jellyfin-web";
|
|
|
|
rev = "v${version}";
|
2022-03-28 09:48:01 +01:00
|
|
|
sha256 = "vLY/rTw2R2WphYbnGK4IJ78OzQTTGOWLd8nXWp8+CQk=";
|
2021-04-24 12:43:32 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
nodejs
|
|
|
|
];
|
|
|
|
|
|
|
|
buildPhase =
|
|
|
|
let
|
|
|
|
nodeDependencies = ((import ./node-composition.nix {
|
|
|
|
inherit pkgs nodejs;
|
|
|
|
inherit (stdenv.hostPlatform) system;
|
|
|
|
}).nodeDependencies.override (old: {
|
|
|
|
# access to path '/nix/store/...-source' is forbidden in restricted mode
|
|
|
|
src = src;
|
|
|
|
|
|
|
|
# dont run the prepare script:
|
|
|
|
# Error: Cannot find module '/nix/store/...-node-dependencies-jellyfin-web-.../jellyfin-web/scripts/prepare.js
|
|
|
|
# npm run build:production runs the same command
|
|
|
|
dontNpmInstall = true;
|
|
|
|
}));
|
|
|
|
in
|
|
|
|
''
|
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
ln -s ${nodeDependencies}/lib/node_modules ./node_modules
|
|
|
|
export PATH="${nodeDependencies}/bin:$PATH"
|
|
|
|
|
|
|
|
npm run build:production
|
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/share
|
|
|
|
cp -a dist $out/share/jellyfin-web
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.updateScript = ./web-update.sh;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Web Client for Jellyfin";
|
|
|
|
homepage = "https://jellyfin.org/";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = with maintainers; [ nyanloutre minijackson purcell jojosch ];
|
2022-04-11 10:05:51 +01:00
|
|
|
platforms = nodejs.meta.platforms;
|
2021-04-24 12:43:32 +01:00
|
|
|
};
|
|
|
|
}
|