Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / games / npush / run.nix
blobbc4a3b5fda3f201331b6fb410f0235f30f1a3016
1 { runtimeShell
2 , symlinkJoin
3 , writeShellScriptBin
4 , npush
5 }:
7 let
8   runScript = writeShellScriptBin "run-npush" ''
9     set -euo pipefail
10     CWD=$(pwd)
12     if [ -d "./levels" ]; then
13       echo "Directory ./levels found; skipping levelset copy"
14     else
15       echo "Directory ./levels not found; copying the official levelset to the current directory"
16       mkdir -p ./levels
17       cp ${npush}/share/npush/levels/* levels/
18       chmod 644 levels/*
19     fi
20     echo "Now calling npush"
21     exec "${npush}/bin/npush"
22   '';
24 symlinkJoin {
25   name = "run-npush-${npush.version}";
27   paths = [
28     npush
29     runScript
30   ];