diff options
Diffstat (limited to 'pkgs/games/npush/run.nix')
-rw-r--r-- | pkgs/games/npush/run.nix | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/pkgs/games/npush/run.nix b/pkgs/games/npush/run.nix new file mode 100644 index 0000000000000..bc4a3b5fda3f2 --- /dev/null +++ b/pkgs/games/npush/run.nix @@ -0,0 +1,31 @@ +{ runtimeShell +, symlinkJoin +, writeShellScriptBin +, npush +}: + +let + runScript = writeShellScriptBin "run-npush" '' + set -euo pipefail + CWD=$(pwd) + + if [ -d "./levels" ]; then + echo "Directory ./levels found; skipping levelset copy" + else + echo "Directory ./levels not found; copying the official levelset to the current directory" + mkdir -p ./levels + cp ${npush}/share/npush/levels/* levels/ + chmod 644 levels/* + fi + echo "Now calling npush" + exec "${npush}/bin/npush" + ''; +in +symlinkJoin { + name = "run-npush-${npush.version}"; + + paths = [ + npush + runScript + ]; +} |