Fix indentation of default.nix.

main
Philipp 2021-07-24 16:48:11 +02:00
parent f436d43868
commit 4dedc187c7
No known key found for this signature in database
GPG Key ID: 2258EE3B85DE1748
1 changed files with 26 additions and 26 deletions

View File

@ -52,9 +52,9 @@ let
script = pkgs.writeShellScriptBin binName '' script = pkgs.writeShellScriptBin binName ''
#sane bash #sane bash
set -eo pipefail set -eo pipefail
function installPrefix () { function installPrefix () {
if [ ! -d "$WINEPREFIX" ]; then if [ ! -d "$WINEPREFIX" ]; then
${winePkg}/bin/wineboot -i ${winePkg}/bin/wineboot -i
#set win 10 #set win 10
@ -90,17 +90,17 @@ let
${lib.concatMapStrings (x: "${regEdit} " + x + "\n") registryFiles} ${lib.concatMapStrings (x: "${regEdit} " + x + "\n") registryFiles}
fi fi
} }
function installLauncher () { function installLauncher () {
installPrefix installPrefix
#install the launcher #install the launcher
echo "Install with default parameters, launcherArgs won't be used when you launch the launcher from the setup" echo "Install with default parameters, launcherArgs won't be used when you launch the launcher from the setup"
${winePkg}/bin/wine ${rsiInstaller} ${winePkg}/bin/wine ${rsiInstaller}
} }
function runGame () { function runGame () {
installPrefix installPrefix
#install the launcher conditionally here and not in the launcher to allow force reinstalls. #install the launcher conditionally here and not in the launcher to allow force reinstalls.
@ -112,45 +112,45 @@ let
${if virtualDesktop != null then "explorer /desktop=${binName},${virtualDesktop}" else ""} \ ${if virtualDesktop != null then "explorer /desktop=${binName},${virtualDesktop}" else ""} \
"$WINEPREFIX/drive_c/Program Files/Roberts Space Industries/RSI Launcher/RSI Launcher.exe" \ "$WINEPREFIX/drive_c/Program Files/Roberts Space Industries/RSI Launcher/RSI Launcher.exe" \
${lib.concatStringsSep " " launcherArgs} ${lib.concatStringsSep " " launcherArgs}
} }
function printPrefix () { function printPrefix () {
echo "$WINEPREFIX" echo "$WINEPREFIX"
} }
function clean () { function clean () {
find "${prefixBaseDir}" -maxdepth 1 -type d -name ????????????????????????????????-"${binName}" -and -not -wholename "$WINEPREFIX" -delete find "${prefixBaseDir}" -maxdepth 1 -type d -name ????????????????????????????????-"${binName}" -and -not -wholename "$WINEPREFIX" -delete
} }
function removePrefix () { function removePrefix () {
#Good thing the GPL contains a no warranty clause #Good thing the GPL contains a no warranty clause
rm -rf "$WINEPREFIX" rm -rf "$WINEPREFIX"
} }
function help () { function help () {
cat ${helpText.text} cat ${helpText.text}
} }
function wine () { function wine () {
installPrefix installPrefix
${winePkg}/bin/"$@" ${winePkg}/bin/"$@"
} }
#base setup #base setup
if [ ! -d "${installDir}" ]; then if [ ! -d "${installDir}" ]; then
mkdir -p "${installDir}/Roberts Space Industries" mkdir -p "${installDir}/Roberts Space Industries"
fi fi
#create base dir for nix installs #create base dir for nix installs
if [ ! -d ${prefixBaseDir} ]; then if [ ! -d ${prefixBaseDir} ]; then
mkdir -p "${prefixBaseDir}" mkdir -p "${prefixBaseDir}"
fi fi
#core idea: Generate UUID from storage path of this script, ensure #core idea: Generate UUID from storage path of this script, ensure
#new prefix for any changes. Needs fast prefix installs and state outside. #new prefix for any changes. Needs fast prefix installs and state outside.
uuid=$(basename $(${pkgs.nix}/bin/nix path-info "$BASH_SOURCE")) uuid=$(basename $(${pkgs.nix}/bin/nix path-info "$BASH_SOURCE"))
export WINEPREFIX="${prefixBaseDir}/$uuid" export WINEPREFIX="${prefixBaseDir}/$uuid"
#export all global env vars #export all global env vars
${lib.concatMapStrings (x: "export " + x + "\n") (wineGlobalEnv ${lib.concatMapStrings (x: "export " + x + "\n") (wineGlobalEnv
@ -158,7 +158,7 @@ let
)} )}
#parse input #parse input
case "$@" in case "$@" in
--install-prefix) --install-prefix)
installPrefix installPrefix
;; ;;
@ -187,7 +187,7 @@ let
*) *)
help help
exit 1 exit 1
esac esac
''; '';
in script in script