From 8c8c62bb6e1e85680ee8faf17862a2b036738130 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Sat, 27 Jul 2024 15:22:55 -0400 Subject: [PATCH] feat(bbsteamie): add setup for palia map --- devices/bbsteamie/default.nix | 2 +- devices/bbsteamie/modules/desktop/default.nix | 30 +++++++ .../modules/desktop/install_palia_map.md | 81 +++++++++++++++++++ .../session-switching.nix} | 81 ++----------------- devices/bbsteamie/modules/desktop/steam.nix | 75 +++++++++++++++++ flake.lock | 17 ++++ flake.nix | 6 ++ flake/inputs.nix | 4 + packages/default.nix | 5 ++ packages/protonhax/default.nix | 16 ++++ 10 files changed, 240 insertions(+), 77 deletions(-) create mode 100644 devices/bbsteamie/modules/desktop/default.nix create mode 100755 devices/bbsteamie/modules/desktop/install_palia_map.md rename devices/bbsteamie/modules/{desktop.nix => desktop/session-switching.nix} (51%) create mode 100644 devices/bbsteamie/modules/desktop/steam.nix create mode 100644 packages/protonhax/default.nix diff --git a/devices/bbsteamie/default.nix b/devices/bbsteamie/default.nix index 90a027dd..569229ad 100644 --- a/devices/bbsteamie/default.nix +++ b/devices/bbsteamie/default.nix @@ -14,7 +14,7 @@ in { ../../modules/kmscon.nix ../../modules/sshd.nix - ./modules/desktop.nix + ./modules/desktop self.nixosModules.plymouth ]; diff --git a/devices/bbsteamie/modules/desktop/default.nix b/devices/bbsteamie/modules/desktop/default.nix new file mode 100644 index 00000000..04cc7561 --- /dev/null +++ b/devices/bbsteamie/modules/desktop/default.nix @@ -0,0 +1,30 @@ +{pkgs, ...}: let + # switch to wayland when possible + defaultSession = "plasmax11"; +in { + imports = [ + (import ./session-switching.nix defaultSession) + (import ./steam.nix defaultSession) + ]; + + services.desktopManager.plasma6.enable = true; + + programs = { + kdeconnect.enable = true; + xwayland.enable = true; + }; + + # Flatpak support for Discover + services.flatpak.enable = true; + services.packagekit.enable = true; + + environment.systemPackages = with pkgs; [ + # Misc Apps + firefox + kdePackages.discover + + # Libs + wl-clipboard + xclip + ]; +} diff --git a/devices/bbsteamie/modules/desktop/install_palia_map.md b/devices/bbsteamie/modules/desktop/install_palia_map.md new file mode 100755 index 00000000..17e9f578 --- /dev/null +++ b/devices/bbsteamie/modules/desktop/install_palia_map.md @@ -0,0 +1,81 @@ +# How to install Palia Map and Overwolf on Linux + +Dependencies: +- latest GE-Proton: https://github.com/GloriousEggroll/proton-ge-custom +- protontricks: https://github.com/Matoking/protontricks +- protonhax: https://github.com/jcnils/protonhax + + +## First Step: Install and run Palia at least once + + +## Second Step: Setup Palia WINEPREFIX with latest GE-Proton + +1. Delete prefix at /home/"$USER"/.steam/steam/steamapps/compatdata/2707930/pfx + +```bash +rm -r /home/"$USER"/.steam/steam/steamapps/compatdata/2707930/pfx +``` + +2. Launch Palia with GE-Proton by going to game properties -> Compatibility -> Force the use ... -> Select GE-Proton... + +3. Install dotnet48 and other Windows deps to allow for Overwolf installation + +```bash +# Force proton version of protontricks +export PROTON_VERSION="GE-Proton9-10" +protontricks 2707930 dotnet48 + +# If VC is needed +protontricks 2707930 vcrun2010 +protontricks 2707930 vcrun2012 +protontricks 2707930 vcrun2013 +``` + + +## Third Step: Install Overwolf + +1. Get this older version that worked for me here: https://overwolf.en.uptodown.com/windows/download/4714215 + +2. Install it with protontricks. Follow the GUI installer as if you were on Windows + +```bash +export PROTON_VERSION="GE-Proton9-10" +protontricks-launch --appid 2707930 Downloads/overwolf-0-195-0-18.exe +``` + + +## Fourth Step: Install Palia Map + +1. Get the installer from here: https://www.overwolf.com/app/Leon_Machens-Palia_Map + +2. Install it with protontricks. + +```bash +export PROTON_VERSION="GE-Proton9-10" +protontricks-launch --appid 2707930 Downloads/Palia\ Map\ -\ Installer.exe +``` + +3. An error should popup saying `Installation failed` or something along those lines. +Close it and wait. You should see the Overwolf overlay on the left side of your screen +with the Palia Map icon saying `Installing` and then when it's done: `Palia Map`. + +If nothing happens, try rebooting your PC and retrying the above shell commands until it works. + + +## Final Step: Setting it up in Steam + +1. Add this line to Palia launch options +```bash +protonhax init %command% +``` + +2. Add random non-steam game to your library and then edit its properties: + +Change the name to `Palia Map` or anything you like + +Change the target to this command: + +```bash +protonhax run 2707930 "/home/$USER/.local/share/Steam/steamapps/compatdata/2707930/pfx/drive_c/users/steamuser/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Overwolf/Palia Map.lnk" +``` diff --git a/devices/bbsteamie/modules/desktop.nix b/devices/bbsteamie/modules/desktop/session-switching.nix similarity index 51% rename from devices/bbsteamie/modules/desktop.nix rename to devices/bbsteamie/modules/desktop/session-switching.nix index a968ffd1..d814a644 100644 --- a/devices/bbsteamie/modules/desktop.nix +++ b/devices/bbsteamie/modules/desktop/session-switching.nix @@ -1,15 +1,12 @@ -{ +defaultSession: { config, lib, pkgs, - self, ... }: let inherit (lib) getExe mkForce; - inherit (config.vars) mainUser; - # FIXME: switch to wayland when possible - defaultSession = "plasmax11"; + inherit (config.vars) mainUser; switch-session = pkgs.writeShellApplication { name = "switch-session"; @@ -31,15 +28,15 @@ ''; in { services = { - xserver.enable = true; - desktopManager.plasma6.enable = true; - displayManager = { sddm = { enable = true; autoLogin.relogin = true; }; }; + + # Needed for sddm TODO: look into wayland SDDM? + xserver.enable = true; }; # Sets the default session at launch @@ -90,72 +87,4 @@ in { terminal = false; type = "Application"; }; - - environment.systemPackages = [ - # Misc apps for DE - pkgs.firefox - pkgs.kdePackages.discover - pkgs.wl-clipboard - - # FIXME:Ryujinx ACNH crashes on OpenGL AND Vulkan - # https://github.com/Ryujinx/Ryujinx/issues/6993 - # https://github.com/Ryujinx/Ryujinx/issues/6708 - self.packages.${pkgs.system}.yuzu - pkgs.steam-rom-manager - ]; - - programs = { - xwayland.enable = true; - kdeconnect.enable = true; - - steam = { - enable = true; - remotePlay.openFirewall = true; - extraCompatPackages = [ - pkgs.proton-ge-bin - ]; - }; - }; - - # Enable flatpak support - services.flatpak.enable = true; - services.packagekit.enable = true; - - # Jovian NixOS settings - jovian.steam = { - # Steam > Settings > System > Enable Developer Mode - # Steam > Developer > CEF Remote Debugging - enable = true; - user = mainUser; - - desktopSession = config.services.displayManager.defaultSession; - }; - - jovian.decky-loader = { - enable = true; - user = mainUser; - stateDir = "/home/${mainUser}/.local/share/decky"; # Keep scoped to user - # https://github.com/Jovian-Experiments/Jovian-NixOS/blob/1171169117f63f1de9ef2ea36efd8dcf377c6d5a/modules/decky-loader.nix#L80-L84 - - extraPackages = with pkgs; [ - # Generic packages - curl - unzip - util-linux - gnugrep - - readline.out - procps - pciutils - libpulseaudio - ]; - - extraPythonPackages = pythonPackages: - with pythonPackages; [ - python - ]; - }; - - # Takes way too long to shutdown - systemd.services."decky-loader".serviceConfig.TimeoutStopSec = "5"; } diff --git a/devices/bbsteamie/modules/desktop/steam.nix b/devices/bbsteamie/modules/desktop/steam.nix new file mode 100644 index 00000000..88eccb06 --- /dev/null +++ b/devices/bbsteamie/modules/desktop/steam.nix @@ -0,0 +1,75 @@ +defaultSession: { + config, + lib, + pkgs, + self, + ... +}: let + inherit (config.vars) mainUser; + + cfg = config.programs.steam; +in { + # Normal Steam Stuff + programs.steam = { + enable = true; + protontricks.enable = true; + + remotePlay.openFirewall = true; + extraCompatPackages = [ + pkgs.proton-ge-bin + ]; + }; + + # Jovian Steam settings + jovian.steam = { + # Steam > Settings > System > Enable Developer Mode + # Steam > Developer > CEF Remote Debugging + enable = true; + user = mainUser; + + environment = { + STEAM_EXTRA_COMPAT_TOOLS_PATHS = + lib.makeSearchPathOutput + "steamcompattool" + "" + cfg.extraCompatPackages; + }; + + desktopSession = defaultSession; + }; + + # Decky settings + jovian.decky-loader = { + enable = true; + user = mainUser; + stateDir = "/home/${mainUser}/.local/share/decky"; # Keep scoped to user + # https://github.com/Jovian-Experiments/Jovian-NixOS/blob/1171169117f63f1de9ef2ea36efd8dcf377c6d5a/modules/decky-loader.nix#L80-L84 + + extraPackages = with pkgs; [ + # Generic packages + curl + unzip + util-linux + gnugrep + + readline.out + procps + pciutils + libpulseaudio + ]; + }; + + # Takes way too long to shutdown + systemd.services."decky-loader".serviceConfig.TimeoutStopSec = "5"; + + # Misc Packages + environment.systemPackages = [ + pkgs.steam-rom-manager + self.packages.${pkgs.system}.protonhax + + # FIXME:Ryujinx ACNH crashes on OpenGL AND Vulkan + # https://github.com/Ryujinx/Ryujinx/issues/6993 + # https://github.com/Ryujinx/Ryujinx/issues/6708 + self.packages.${pkgs.system}.yuzu + ]; +} diff --git a/flake.lock b/flake.lock index 76ef84a7..b66f3377 100644 --- a/flake.lock +++ b/flake.lock @@ -1659,6 +1659,22 @@ "type": "github" } }, + "protonhax-src": { + "flake": false, + "locked": { + "lastModified": 1713046416, + "narHash": "sha256-+saVvriwU6gu9pRaV3mVud8i2FXZ/o28K3iBmaUGDig=", + "owner": "jcnils", + "repo": "protonhax", + "rev": "449ce8cd2a86034499fcea1cba249ad79c93fdeb", + "type": "github" + }, + "original": { + "owner": "jcnils", + "repo": "protonhax", + "type": "github" + } + }, "root": { "inputs": { "Hyprspace": "Hyprspace", @@ -1707,6 +1723,7 @@ "pcsd": "pcsd", "piper-src": "piper-src", "pokemon-colorscripts-src": "pokemon-colorscripts-src", + "protonhax-src": "protonhax-src", "secrets": "secrets", "sioyek-theme-src": "sioyek-theme-src", "sops-nix": "sops-nix_2", diff --git a/flake.nix b/flake.nix index 4a840ecd..0c8c02f7 100644 --- a/flake.nix +++ b/flake.nix @@ -275,6 +275,12 @@ repo = "pokemon-colorscripts"; type = "gitlab"; }; + protonhax-src = { + flake = false; + owner = "jcnils"; + repo = "protonhax"; + type = "github"; + }; secrets = { inputs.nixpkgs.follows = "nixpkgs"; type = "git"; diff --git a/flake/inputs.nix b/flake/inputs.nix index f83b070b..fd6fbe49 100644 --- a/flake/inputs.nix +++ b/flake/inputs.nix @@ -216,6 +216,10 @@ let owner = "gjsify"; repo = "ts-for-gir"; } + { + owner = "jcnils"; + repo = "protonhax"; + } # MPV scripts { diff --git a/packages/default.nix b/packages/default.nix index fe162873..400e09cd 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -19,6 +19,11 @@ inherit mkVersion; }; + protonhax = pkgs.callPackage ./protonhax { + inherit (inputs) protonhax-src; + inherit mkVersion; + }; + repl = pkgs.callPackage ./repl {}; trash-d = pkgs.callPackage ./trash-d { diff --git a/packages/protonhax/default.nix b/packages/protonhax/default.nix new file mode 100644 index 00000000..21595a6d --- /dev/null +++ b/packages/protonhax/default.nix @@ -0,0 +1,16 @@ +{ + mkVersion, + protonhax-src, + stdenv, + ... +}: +stdenv.mkDerivation { + pname = "protonhax"; + version = mkVersion protonhax-src; + + src = protonhax-src; + + installPhase = '' + install -Dt $out/bin -m755 protonhax + ''; +}