Add proton-launch

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-07-26 15:29:16 +01:00
parent db63042d16
commit 095f1d063a
3 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
{ user, home }:
{ lib, pkgs, ... }:
{
environment.persistence."/persist/state"."${home}/.local/share/proton" = { };
home-manager.users.${user}.home.packages = [
(pkgs.writeShellApplication {
name = "proton-launch";
runtimeInputs = with pkgs; [ coreutils ];
runtimeEnv = {
PROTON = lib.makeSearchPathOutput "steamcompattool" "" [ pkgs.proton-ge-bin ];
STEAM_RUN = lib.meta.getExe pkgs.steam-run;
};
text = builtins.readFile ./proton-launch.sh;
})
];
}

View File

@@ -0,0 +1,15 @@
if [ "$#" -lt 1 ]; then
echo "Usage: $0 <executable-path> [args...]"
exit 1
fi
PROTON_DATA="$HOME/.local/share/proton"
exec="$(realpath "$1")"
name="$(basename "$exec")"
mkdir -p "$PROTON_DATA/$name"
export STEAM_COMPAT_DATA_PATH="$PROTON_DATA/$name"
export STEAM_COMPAT_CLIENT_INSTALL_PATH="$PROTON"
"$STEAM_RUN" "$PROTON/proton" run "$exec" "${@:2}" >/dev/null 2>&1 & disown