nixos-configs/devices/nos/modules/jellyfin/packages.nix

38 lines
903 B
Nix
Raw Normal View History

{
config,
lib,
pkgs,
...
}: let
inherit (lib) hasAttr optionals;
jellyPkgs =
2024-03-03 17:34:21 -05:00
if config.nvidia.enableCUDA
then pkgs.cudaPackages.pkgs
else pkgs;
in {
services.jellyfin.package = jellyPkgs.jellyfin;
environment.systemPackages = [
jellyPkgs.jellyfin
jellyPkgs.jellyfin-ffmpeg
(jellyPkgs.jellyfin-web.overrideAttrs (_: o: {
patches =
[
(pkgs.fetchpatch {
name = "skipintro.patch";
url = "https://pastebin.com/raw/EEgvReaw";
hash = "sha256-kfvOz0ukDY09kkbmZi24ch5KWJsVcThNEVnjlk4sAC0=";
})
]
++ optionals (hasAttr "patches" o) o.patches;
# Enable backdrops by default
postInstall = ''
sed -E -i 's/enableBackdrops\:function\(\)\{return P\}/enableBackdrops\:function\(\)\{return \_\}/' $out/share/jellyfin-web/main.jellyfin.bundle.js
'';
}))
];
}