mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 22:43:01 +00:00
78c338cb10
Also, adding a helper run-npush that takes care of preparing the game to run with the official levelset.
32 lines
622 B
Nix
32 lines
622 B
Nix
{ 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
|
|
];
|
|
}
|