diff --git a/pkgs/servers/plex/default.nix b/pkgs/servers/plex/default.nix index 1855ac1af54d..b989959b6255 100644 --- a/pkgs/servers/plex/default.nix +++ b/pkgs/servers/plex/default.nix @@ -1,6 +1,6 @@ # The actual Plex package that we run is a FHS userenv of the "raw" package. { stdenv -, buildFHSUserEnv +, buildFHSUserEnvBubblewrap , writeScript , plexRaw @@ -9,10 +9,16 @@ , dataDir ? "/var/lib/plex" }: -buildFHSUserEnv { +buildFHSUserEnvBubblewrap { name = "plexmediaserver"; + inherit (plexRaw) meta; + # Plex does some magic to detect if it is already running. + # The separate PID namespace somehow breaks this and Plex is thinking it's already + # running and refuses to start. + unsharePid = false; + # This script is run when we start our Plex binary runScript = writeScript "plex-run-script" '' #!${stdenv.shell} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 31e45746dac8..b7a26c02ae4d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9882,9 +9882,8 @@ with pkgs; inherit (callPackage ../servers/plik { }) plik plikd; - plex = callPackage ../servers/plex { - buildFHSUserEnv = buildFHSUserEnvBubblewrap; - }; + plex = callPackage ../servers/plex { }; + plexRaw = callPackage ../servers/plex/raw.nix { }; psitransfer = callPackage ../servers/psitransfer { };