diff --git a/pkgs/openmw/tes3mp.nix b/pkgs/openmw/tes3mp.nix index a3afac0..9cd442c 100644 --- a/pkgs/openmw/tes3mp.nix +++ b/pkgs/openmw/tes3mp.nix @@ -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" + ''; }