nixpkgs/pkgs/applications/video/jellyfin-mpv-shim/default.nix

61 lines
1.4 KiB
Nix

{ lib, buildPythonApplication, fetchPypi
, mpv, python-mpv-jsonipc, jellyfin-apiclient-python
, pillow, tkinter, pystray, jinja2, pywebview }:
buildPythonApplication rec {
pname = "jellyfin-mpv-shim";
version = "1.7.1";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-Fo1auMiYUgJrJGJII+FfHspcke0r/VSSXzGwVNIHtEE=";
};
patches = [
./disable-desktop-client.patch
];
# override $HOME directory:
# error: [Errno 13] Permission denied: '/homeless-shelter'
#
# remove jellyfin_mpv_shim/win_utils.py:
# ModuleNotFoundError: No module named 'win32gui'
preCheck = ''
export HOME=$TMPDIR
rm jellyfin_mpv_shim/win_utils.py
'';
postPatch = ''
substituteInPlace jellyfin_mpv_shim/conf.py \
--replace "check_updates: bool = True" "check_updates: bool = False" \
--replace "notify_updates: bool = True" "notify_updates: bool = False"
'';
propagatedBuildInputs = [
jellyfin-apiclient-python
mpv
pillow
python-mpv-jsonipc
# gui dependencies
pystray
tkinter
# display_mirror dependencies
jinja2
pywebview
];
# no tests
doCheck = false;
pythonImportsCheck = [ "jellyfin_mpv_shim" ];
meta = with lib; {
homepage = "https://github.com/iwalton3/jellyfin-mpv-shim";
description = "Allows casting of videos to MPV via the jellyfin mobile and web app";
license = licenses.gpl3;
maintainers = with maintainers; [ jojosch ];
};
}