Skip to content

Commit

Permalink
star-citizen 1.6.10 -> 2.03
Browse files Browse the repository at this point in the history
* Bump star-citizen to 2.0.3
* change winetricks version to winetricks-git
* Add options `enableGameScope` `gameScopeArgs`
  • Loading branch information
LovingMelody committed Sep 8, 2024
1 parent d5bf74c commit 5f1a1aa
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 54 deletions.
1 change: 1 addition & 0 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@

star-citizen = pkgs.callPackage ./star-citizen {
wine = config.packages.wine-ge;
winetricks = config.packages.winetricks-git;
inherit (config.packages) umu;
};
star-citizen-umu = config.packages.star-citizen.override {useUmu = true;};
Expand Down
62 changes: 36 additions & 26 deletions pkgs/star-citizen/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
symlinkJoin,
writeShellScriptBin,
gamemode,
gamescope,
winetricks,
wine,
dxvk,
Expand All @@ -13,67 +14,78 @@
wineFlags ? "",
pname ? "star-citizen",
location ? "$HOME/Games/star-citizen",
tricks ? [],
tricks ? ["powershell"],
useUmu ? false,
protonPath ? "${proton-ge-bin.steamcompattool}/",
steamRuntime ? "${steamPackages.steam-runtime}/",
protonVerbs ? ["waitforexitandrun"],
wineDllOverrides ? ["powershell.exe=n"],
wineDllOverrides ? [],
gameScopeEnable ? false,
gameScopeArgs ? [],
preCommands ? "",
postCommands ? "",
enableGlCache ? true,
glCacheSize ? 1073741824,
pkgs,
}: let
inherit (lib.strings) concatStringsSep optionalString;
version = "1.6.10";
# Latest version can be found: https://install.robertsspaceindustries.com/star-citizen/latest.yml
version = "2.0.3";
src = pkgs.fetchurl {
url = "https://install.robertsspaceindustries.com/star-citizen/RSI-Setup-${version}.exe";
name = "RSI-Setup-${version}.exe";
hash = "sha256-axttJvw3MFmhLC4e+aqtf4qx0Z0x4vz78LElyGkMAbs=";
url = "https://install.robertsspaceindustries.com/rel/2/RSI%20Launcher-Setup-${version}.exe";
name = "RSI Launcher-Setup-${version}.exe";
hash = "sha256-tnhbAuS49Hg550nR0gmetdoetI884RfATipNyzyOFOE=";
};

# Powershell stub for star-citizen
powershell-stub = pkgs.callPackage ./powershell-stub.nix {};

# concat winetricks args
tricksFmt =
if (builtins.length tricks) > 0
then concatStringsSep " " tricks
else "-V";

gameScope = lib.strings.optionalString gameScopeEnable "${gamescope}/bin/gamescope ${concatStringsSep " " gameScopeArgs} --";

script = writeShellScriptBin pname ''
export WINETRICKS_LATEST_VERSION_CHECK=disabled
export WINEARCH="win64"
export WINEPREFIX="${location}"
${optionalString
${
optionalString
#this option doesn't work on umu, an umu TOML config file will be needed instead
(!useUmu) ''
(!useUmu)
''
export WINEFSYNC=1
export WINEESYNC=1
export WINEDLLOVERRIDES="${lib.strings.concatStringsSep "," wineDllOverrides}"
''}
# Anti-cheat
export EOS_USE_ANTICHEATCLIENTNULL=1
# Nvidia tweaks
export WINE_HIDE_NVIDIA_GPU=1
# AMD
export dual_color_blend_by_location="true"
''
}
# ID for umu, not used for now
export GAMEID="umu-starcitizen"
export STORE="none"
# Anti-cheat
export EOS_USE_ANTICHEATCLIENTNULL=1
# Nvidia tweaks
export WINE_HIDE_NVIDIA_GPU=1
export __GL_SHADER_DISK_CACHE=${
if enableGlCache
then "1"
else "0"
}
export __GL_SHADER_DISK_CACHE_SIZE=${toString glCacheSize}
export WINE_HIDE_NVIDIA_GPU=1
# AMD
export dual_color_blend_by_location="true"
PATH=${lib.makeBinPath (
if useUmu
then [umu]
else [wine winetricks]
)}:$PATH
PATH=${
lib.makeBinPath (
if useUmu
then [umu]
else [wine winetricks]
)
}:$PATH
USER="$(whoami)"
RSI_LAUNCHER="$WINEPREFIX/drive_c/Program Files/Roberts Space Industries/RSI Launcher/RSI Launcher.exe"
${
Expand Down Expand Up @@ -108,16 +120,14 @@
fi
cd $WINEPREFIX
${powershell-stub}/bin/install.sh
${preCommands}
${
if useUmu
then ''
${gamemode}/bin/gamemoderun umu-run "$RSI_LAUNCHER" "$@"
${gameScope} ${gamemode}/bin/gamemoderun umu-run "$RSI_LAUNCHER" "$@"
''
else ''
${gamemode}/bin/gamemoderun wine ${wineFlags} "$RSI_LAUNCHER" "$@"
${gameScope} ${gamemode}/bin/gamemoderun wine ${wineFlags} "$RSI_LAUNCHER" "$@"
wineserver -w
''
}
Expand Down
28 changes: 0 additions & 28 deletions pkgs/star-citizen/powershell-stub.nix

This file was deleted.

0 comments on commit 5f1a1aa

Please sign in to comment.