lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 24.05-pre 47 lines 1.1 kB view raw
1{ lib, symlinkJoin, makeWrapper }: 2 3unwrapped: 4 5pkgsSpec: 6 7let 8 mods = if lib.isFunction pkgsSpec 9 then pkgsSpec unwrapped.pkgs 10 else pkgsSpec; 11in 12 13if builtins.length mods == 0 14then unwrapped 15else symlinkJoin { 16 name = unwrapped.name + "-with-mods"; 17 18 paths = [ unwrapped ] ++ mods; 19 20 nativeBuildInputs = [ makeWrapper ]; 21 22 postBuild = '' 23 if [ -x $out/bin/cataclysm ]; then 24 wrapProgram $out/bin/cataclysm \ 25 --add-flags "--datadir $out/share/cataclysm-dda/" 26 fi 27 if [ -x $out/bin/cataclysm-tiles ]; then 28 wrapProgram $out/bin/cataclysm-tiles \ 29 --add-flags "--datadir $out/share/cataclysm-dda/" 30 fi 31 32 # Launch the wrapped program 33 replaceProgram() { 34 cp "$1" "''${1}.bk" 35 unlink "$1" 36 mv "''${1}.bk" "$1" 37 sed -i "$1" -e "s,${builtins.storeDir}/.\+\(/bin/cataclysm-tiles\),$out\1," 38 } 39 for script in "$out/share/applications/cataclysm-dda.desktop" \ 40 "$out/Applications/Cataclysm.app/Contents/MacOS/Cataclysm.sh" 41 do 42 if [ -e "$script" ]; then 43 replaceProgram "$script" 44 fi 45 done 46 ''; 47}