dirty hacks to make openmw-tes3mp work

This commit is contained in:
Christian Ulrich 2023-03-12 23:11:42 +01:00
parent ff8b3cc2b9
commit 9961d28ea5
No known key found for this signature in database
GPG Key ID: 8241BE099775A097
1 changed files with 13 additions and 3 deletions

View File

@ -109,8 +109,12 @@ let
};
});
cfgDir="/home/christian/.config/openmw";
serverDir="/home/christian/.local/share/openmw/server";
cfgFile = (formats.ini { }).generate "tes3mp-server.cfg" {
Plugins.home = "${coreScripts}/share/openmw-tes3mp/CoreScripts";
Plugins.home = "${serverDir}";
};
in
@ -122,7 +126,6 @@ symlinkJoin rec {
paths = [ unwrapped ];
cfgDir="\\$HOME/.config/openmw";
# crudini --merge will create the file if it doesn't exist
postBuild = ''
@ -133,7 +136,14 @@ symlinkJoin rec {
makeWrapper ${unwrapped}/libexec/tes3mp-server $out/bin/tes3mp-server \
--run "mkdir -p ${cfgDir}" \
--run "mkdir -p ${serverDir}" \
--run "${crudini}/bin/crudini --merge ${cfgDir}/${cfgFile.name} < ${cfgFile}" \
--chdir "$out/bin"
--run "cd ${serverDir}" \
--run "rm -f lib scripts" \
--run "ln -s ${coreScripts}/share/openmw-tes3mp/CoreScripts/lib lib" \
--run "ln -s ${coreScripts}/share/openmw-tes3mp/CoreScripts/scripts scripts" \
--run "[ ! -d data ] && cp -R ${coreScripts}/share/openmw-tes3mp/CoreScripts/data data" \
--run "chmod -R u+w data"
'';
}