anchor.diff:        type = "Application";
         categories = "Game;";
       }}/share/applications $out/share
  -
  -    runHook postInstall
     '';
  -
  -  # Strip breaks the executable.
  -  dontStrip = true;
   
     meta = with lib; {
       description = "Experimental Nintendo Switch Emulator written in C#";
  
positive.code: { lib, stdenv, fetchFromGitHub, fetchurl, makeWrapper, makeDesktopItem, linkFarmFromDrvs
  , dotnet-sdk_5, dotnetPackages, dotnetCorePackages, cacert
  , libX11, libgdiplus, ffmpeg
  , SDL2_mixer, openal, libsoundio, sndio, pulseaudio
  , gtk3, gobject-introspection, gdk-pixbuf, wrapGAppsHook
  }:
  
  let
    runtimeDeps = [
      gtk3
      libX11
  
negative.code:     sndio
      pulseaudio
    ];
  
    patches = [
      ./log.patch # Without this, Ryujinx attempts to write logs to the nix store. This patch makes it write to "~/.config/Ryujinx/Logs" on Linux.
    ];
  
    preInstall = ''
      # TODO: fix this hack https://github.com/Ryujinx/Ryujinx/issues/2349
      mkdir -p $out/lib/sndio-6
      ln -s ${sndio}/lib/libsndio.so $out/lib/sndio-6/libsndio.so.6
  
      makeWrapperArgs+=(
        --suffix LD_LIBRARY_PATH : "$out/lib/sndio-6"
      )
  
      for i in 16 32 48 64 96 128 256 512 1024; do
        install -D ${src}/Ryujinx/Ui/Resources/Logo_Ryujinx.png $out/share/icons/hicolor/''${i}x$i/apps/ryujinx.png
      done
  
      cp -r ${makeDesktopItem {
        desktopName = "Ryujinx";
        name = "ryujinx";
  