From f75933378e0b3a0bfbe791a9c71f030546ea8220 Mon Sep 17 00:00:00 2001 From: detroyejr Date: Mon, 18 Nov 2024 13:06:15 -0500 Subject: [PATCH 1/2] plex-desktop: add libdrm to FHS environment --- pkgs/by-name/pl/plex-desktop/package.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/pl/plex-desktop/package.nix b/pkgs/by-name/pl/plex-desktop/package.nix index aa79d6040db49..52d98ec47fbc4 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 From e1a323aaf84728eaf21fb771e7971608334f79f1 Mon Sep 17 00:00:00 2001 From: detroyejr Date: Tue, 17 Dec 2024 22:55:21 -0500 Subject: [PATCH 2/2] plex-desktop: update sqlite write permissions --- pkgs/by-name/pl/plex-desktop/package.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/by-name/pl/plex-desktop/package.nix b/pkgs/by-name/pl/plex-desktop/package.nix index 52d98ec47fbc4..bfa7e9bcfeb98 100644 --- a/pkgs/by-name/pl/plex-desktop/package.nix +++ b/pkgs/by-name/pl/plex-desktop/package.nix @@ -140,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