12 mods = if lib.isFunction pkgsSpec then pkgsSpec unwrapped.pkgs else pkgsSpec;
15 if builtins.length mods == 0 then
19 name = unwrapped.name + "-with-mods";
21 paths = [ unwrapped ] ++ mods;
23 nativeBuildInputs = [ makeWrapper ];
26 if [ -x $out/bin/cataclysm ]; then
27 wrapProgram $out/bin/cataclysm \
28 --add-flags "--datadir $out/share/cataclysm-dda/"
30 if [ -x $out/bin/cataclysm-tiles ]; then
31 wrapProgram $out/bin/cataclysm-tiles \
32 --add-flags "--datadir $out/share/cataclysm-dda/"
35 # Launch the wrapped program
40 sed -i "$1" -e "s,${builtins.storeDir}/.\+\(/bin/cataclysm-tiles\),$out\1,"
42 for script in "$out/share/applications/cataclysm-dda.desktop" \
43 "$out/Applications/Cataclysm.app/Contents/MacOS/Cataclysm.sh"
45 if [ -e "$script" ]; then
46 replaceProgram "$script"