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 ''
#sane bash
set -eo pipefail
set -eo pipefail
function installPrefix () {
function installPrefix () {
if [ ! -d "$WINEPREFIX" ]; then
${winePkg}/bin/wineboot -i
#set win 10
@ -90,17 +90,17 @@ let
${lib.concatMapStrings (x: "${regEdit} " + x + "\n") registryFiles}
fi
}
}
function installLauncher () {
function installLauncher () {
installPrefix
#install the launcher
echo "Install with default parameters, launcherArgs won't be used when you launch the launcher from the setup"
${winePkg}/bin/wine ${rsiInstaller}
}
}
function runGame () {
function runGame () {
installPrefix
#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 ""} \
"$WINEPREFIX/drive_c/Program Files/Roberts Space Industries/RSI Launcher/RSI Launcher.exe" \
${lib.concatStringsSep " " launcherArgs}
}
}
function printPrefix () {
function printPrefix () {
echo "$WINEPREFIX"
}
}
function clean () {
function clean () {
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
rm -rf "$WINEPREFIX"
}
}
function help () {
function help () {
cat ${helpText.text}
}
}
function wine () {
function wine () {
installPrefix
${winePkg}/bin/"$@"
}
}
#base setup
if [ ! -d "${installDir}" ]; then
if [ ! -d "${installDir}" ]; then
mkdir -p "${installDir}/Roberts Space Industries"
fi
fi
#create base dir for nix installs
if [ ! -d ${prefixBaseDir} ]; then
if [ ! -d ${prefixBaseDir} ]; then
mkdir -p "${prefixBaseDir}"
fi
fi
#core idea: Generate UUID from storage path of this script, ensure
#new prefix for any changes. Needs fast prefix installs and state outside.
uuid=$(basename $(${pkgs.nix}/bin/nix path-info "$BASH_SOURCE"))
export WINEPREFIX="${prefixBaseDir}/$uuid"
uuid=$(basename $(${pkgs.nix}/bin/nix path-info "$BASH_SOURCE"))
export WINEPREFIX="${prefixBaseDir}/$uuid"
#export all global env vars
${lib.concatMapStrings (x: "export " + x + "\n") (wineGlobalEnv
@ -158,7 +158,7 @@ let
)}
#parse input
case "$@" in
case "$@" in
--install-prefix)
installPrefix
;;
@ -187,7 +187,7 @@ let
*)
help
exit 1
esac
'';
esac
'';
in script