diff --git a/nixos/plex.nix b/nixos/plex.nix index e14be9bd..a8981046 100644 --- a/nixos/plex.nix +++ b/nixos/plex.nix @@ -10,12 +10,23 @@ in { services.plex.enable = mkDefault true; systemd.services.plex = mkIf cfg.enable { + gensokyo-zone = { + sharedMounts.plex.path = mkDefault cfg.dataDir; + cacheMounts = { + "plex/Cache" = { + path = mkDefault "${cfg.dataDir}/Cache"; + }; + "plex/Logs" = { + path = mkDefault "${cfg.dataDir}/Logs"; + }; + "plex/mesa_shader_cache" = { + path = mkDefault "${cfg.dataDir}/mesa_shader_cache"; + }; + }; + }; # /var/lib/plex/mesa_shader_cache environment.MESA_SHADER_CACHE_DIR = mkDefault cfg.dataDir; serviceConfig = { - BindPaths = [ - ''/mnt/caches/plex/Cache:${cfg.dataDir}/Cache'' - ]; ExecStartPre = let # systemd doesn't seem to like spaces so use a symlink instead... preStartScript = pkgs.writeShellScript "plex-run-prestart" '' @@ -25,6 +36,7 @@ in { ${pkgs.coreutils}/bin/install -d -m 0755 -o ${escapeShellArg cfg.user} -g ${escapeShellArg cfg.group} "$PLEX_DATADIR/Plex Media Server" fi ${pkgs.coreutils}/bin/ln -sfT ../Cache "$PLEX_DATADIR/Plex Media Server/Cache" + ${pkgs.coreutils}/bin/ln -sfT ../Logs "$PLEX_DATADIR/Plex Media Server/Logs" ''; in mkForce [ diff --git a/systems/reisen/setup.sh b/systems/reisen/setup.sh index d900b51f..995b8cf4 100644 --- a/systems/reisen/setup.sh +++ b/systems/reisen/setup.sh @@ -165,11 +165,17 @@ mkcache plex 0 0 0755 if [[ ! -d /rpool/caches/plex/Cache ]]; then mkdir /rpool/caches/plex/Cache fi +if [[ ! -d /rpool/caches/plex/Logs ]]; then + mkdir /rpool/caches/plex/Logs +fi +if [[ ! -d /rpool/caches/plex/mesa_shader_cache ]]; then + mkdir /rpool/caches/plex/mesa_shader_cache +fi if [[ ! -d /rpool/caches/plex/tautulli/cache ]]; then mkdir -p /rpool/caches/plex/tautulli/cache fi -chown 100193:100193 /rpool/caches/plex/Cache -chmod 0775 /rpool/caches/plex/Cache +chown 100193:100193 /rpool/caches/plex/{Cache,Logs,mesa_shader_cache} +chmod 0775 /rpool/caches/plex/{Cache,Logs,mesa_shader_cache} chown 100195:65534 /rpool/caches/plex/tautulli/cache chmod 0755 /rpool/caches/plex/tautulli/cache