From 4183e23bcb34b4066d5d77d725c5dda66c743738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Madeleine=20Sydney=20=C5=9Alaga?= Date: Tue, 24 Jun 2025 15:01:53 -0600 Subject: [PATCH] slippi-launcher-bin: init AppImage build --- .gitignore | 2 + flake.nix | 17 ++++++++ pkgs/slippi-launcher-bin/default.nix | 58 ++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 pkgs/slippi-launcher-bin/default.nix diff --git a/.gitignore b/.gitignore index 7dc3520..8f293a5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ result result-* + +slippi-ld-log.* \ No newline at end of file diff --git a/flake.nix b/flake.nix index 0749d98..da51666 100644 --- a/flake.nix +++ b/flake.nix @@ -19,5 +19,22 @@ lib.filterAttrs (_: v: lib.isDerivation v) self.legacyPackages.${system}); + + devShells.x86_64-linux.slippi = + let + pkgs = import inputs.nixpkgs { system = "x86_64-linux"; }; + in self.packages.x86_64-linux.slippi-launcher.env.overrideAttrs + (final: prev: { + shellHook = + builtins.replaceStrings + ["exec \"\${cmd[@]}\""] + ['' + echo "''${cmd[-1]}" + unset cmd[-1] + cmd+=("$SHELL") + exec "''${cmd[@]}" + ''] + prev.shellHook; + }); }; } diff --git a/pkgs/slippi-launcher-bin/default.nix b/pkgs/slippi-launcher-bin/default.nix new file mode 100644 index 0000000..c9b7680 --- /dev/null +++ b/pkgs/slippi-launcher-bin/default.nix @@ -0,0 +1,58 @@ +{ lib +, appimageTools +, fetchurl +, fuse3 +, makeWrapper +}: + +# WARNING: This package is a fucking hack! Two things: +# +# - You must manually patch the Dolphin emulator installed by Slippi. After +# Dolphin is installed (i.e. once the 'play' button is clickable), you must +# navigate to ~/.cache/appimage-run/*/apprun-hooks/linux-env.sh and +# delete/comment the lines modifying LD_LIBRARY_PATH. I hope to fix this at +# some point, but it took me like 15 hours just to attain this bare minimum +# functionality, rofl. Good luck. Open an issue or contact me (msyds) if you +# need assistance. +# +# - Requires +# programs.appimage = { +# enable = true; +# binfmt = true; +# }; +# in your NixOS config. This is because Slippi tries to run the Dolphin +# AppImage like a normal executable. + +appimageTools.wrapType2 rec { + pname = "slippi-launcher"; + version = "2.11.10"; + + src = fetchurl { + url = "https://github.com/project-slippi/slippi-launcher/releases/download/v${version}/Slippi-Launcher-${version}-x86_64.AppImage"; + hash = "sha256-OrWd0jVqe6CzNbVRNlm2alt2NZ8uBYeHiASaB74ouW4="; + }; + + nativeBuildInputs = [ + makeWrapper + ]; + + extraPkgs = pkgs: [ + pkgs.fuse3 + ]; + + extraInstallCommands = '' + wrapProgram $out/bin/slippi-launcher \ + --set FUSERMOUNT_PROG "${fuse3}/bin/fusermount3" \ + --add-flags "''${NIXOS_OZONE_WL:+''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" + ''; + + # note to madddy./.. DELETE "ubuntu is stupid" LINE FROM ~/.cache/appimage-run/XXXXX/shell-hooks/a + meta = { + description = "The way to play Slippi Online and watch replays."; + homepage = "https://github.com/project-slippi/slippi-launcher"; + downloadPage = "https://github.com/project-slippi/slippi-launcher/releases"; + license = lib.licenses.gpl3; + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; + platforms = [ "x86_64-linux" ]; + }; +}