anchor.diff:      install -D ./ryujinx-mime.xml $out/share/mime/packages/ryujinx-mime.xml
       install -D ./ryujinx-logo.svg $out/share/icons/hicolor/scalable/apps/ryujinx.svg
   
  -    substituteInPlace $out/share/applications/ryujinx.desktop --replace \
  -      "Exec=Ryujinx" "Exec=$out/bin/Ryujinx"
  +    substituteInPlace $out/share/applications/ryujinx.desktop \
  +      --replace "Exec=Ryujinx" "Exec=$out/bin/Ryujinx"
  +
  +    ln -s $out/bin/Ryujinx $out/bin/ryujinx
   
       popd
     '';
  
positive.code: , libXrandr
  , fontconfig
  , glew
  }:
  
  buildDotnetModule rec {
    pname = "ryujinx";
    version = "1.1.223"; # Based off of the official github actions builds: https://github.com/Ryujinx/Ryujinx/actions/workflows/release.yml
  
    src = fetchFromGitHub {
      owner = "Ryujinx";
      repo = "Ryujinx";
      rev = "951700fdd8f54fb34ffe8a3fb328a68b5bf37abe";
      sha256 = "0kzchsxir8wh74rxvp582mci855hbd0vma6yhcc9vpz0zmhi2cpf";
    };
  
    projectFile = "Ryujinx.sln";
    nugetDeps = ./deps.nix;
  
    dotnetFlags = [ "/p:ExtraDefineConstants=DISABLE_UPDATER" ];
  
    # TODO: Add the headless frontend. Currently errors on the following:
    # System.Exception: SDL2 initlaization failed with error "No available video device"
    executables = [ "Ryujinx" "Ryujinx.Ava" ];
  
    nativeBuildInputs = [
      wrapGAppsHook
  
negative.code: { lib
  , buildDotnetModule
  , fetchFromGitHub
  , wrapGAppsHook
  , libX11
  , libgdiplus
  , ffmpeg
  , openal
  , libsoundio
  , sndio
  , pulseaudio
  , gtk3
  , gdk-pixbuf
  , vulkan-loader
  , libICE
  , libSM
  