1 { lib, symlinkJoin, makeWrapper }:
8 mods = if lib.isFunction pkgsSpec
9 then pkgsSpec unwrapped.pkgs
13 if builtins.length mods == 0
16 name = unwrapped.name + "-with-mods";
18 paths = [ unwrapped ] ++ mods;
20 nativeBuildInputs = [ makeWrapper ];
23 if [ -x $out/bin/cataclysm ]; then
24 wrapProgram $out/bin/cataclysm \
25 --add-flags "--datadir $out/share/cataclysm-dda/"
27 if [ -x $out/bin/cataclysm-tiles ]; then
28 wrapProgram $out/bin/cataclysm-tiles \
29 --add-flags "--datadir $out/share/cataclysm-dda/"
32 # Launch the wrapped program
37 sed -i "$1" -e "s,${builtins.storeDir}/.\+\(/bin/cataclysm-tiles\),$out\1,"
39 for script in "$out/share/applications/cataclysm-dda.desktop" \
40 "$out/Applications/Cataclysm.app/Contents/MacOS/Cataclysm.sh"
42 if [ -e "$script" ]; then
43 replaceProgram "$script"