anchor.diff:      # to the '/db' file; we create this path in the FHS userenv (see the "plex"
       # package).
       ln -fs /db $f
  +    runHook postInstall
     '';
   
     # We're running in a FHS userenv; don't patch anything
  
positive.code: # server, and the FHS userenv and corresponding NixOS module should
  # automatically pick up the changes.
  stdenv.mkDerivation rec {
    version = "1.21.3.4046-3c1c83ba4";
    pname = "plexmediaserver";
  
    # Fetch the source
    src = if stdenv.hostPlatform.system == "aarch64-linux" then fetchurl {
      url = "https://downloads.plex.tv/plex-media-server-new/${version}/debian/plexmediaserver_${version}_arm64.deb";
      sha256 = "1ikv75pgircqnllimx3yszihpfaj8blhrmgvli0lagirx6sg22zl";
    } else fetchurl {
      url = "https://downloads.plex.tv/plex-media-server-new/${version}/debian/plexmediaserver_${version}_amd64.deb";
      sha256 = "1fywpkchpc726a66q7xpqrn92g73v4941df19glscrrvy7808f8n";
    };
  
    outputs = [ "out" "basedb" ];
  
negative.code:   '';
  
    installPhase = ''
      runHook preInstall
      mkdir -p "$out/lib"
      cp -dr --no-preserve='ownership' usr/lib/plexmediaserver $out/lib/
  
  