diff --git a/pkgs/by-name/pl/plex-desktop/package.nix b/pkgs/by-name/pl/plex-desktop/package.nix index aa79d6040db49..bfa7e9bcfeb98 100644 --- a/pkgs/by-name/pl/plex-desktop/package.nix +++ b/pkgs/by-name/pl/plex-desktop/package.nix @@ -14,6 +14,7 @@ libGL, libapparmor, libbsd, + libdrm, libedit, libffi_3_3, libgcrypt, @@ -122,7 +123,10 @@ let in buildFHSEnv { inherit pname version meta; - targetPkgs = pkgs: [ xkeyboard_config ]; + targetPkgs = pkgs: [ + libdrm + xkeyboard_config + ]; extraInstallCommands = '' mkdir -p $out/share/applications $out/share/icons/hicolor/scalable/apps @@ -136,6 +140,17 @@ buildFHSEnv { runScript = writeShellScript "plex-desktop.sh" '' # Widevine won't download unless this directory exists. mkdir -p $HOME/.cache/plex/ + + # Copy the sqlite plugin database on first run. + PLEX_DB="$HOME/.local/share/plex/Plex Media Server/Plug-in Support/Databases" + if [[ ! -d "$PLEX_DB" ]]; then + mkdir -p "$PLEX_DB" + cp "${plex-desktop}/resources/com.plexapp.plugins.library.db" "$PLEX_DB" + fi + + # db files should have write access. + chmod --recursive 750 "$PLEX_DB" + PLEX_USR_PATH=${lib.makeSearchPath "usr/lib/x86_64-linux-gnu" [ plex-desktop ]} set -o allexport