Something like this:
wrapPackage {
inherit pkgs;
package = pkgs.cowsay;
wrapperScript = ''
"$EXE_PATH" "$@" >"$XDG_DATA_HOME/cowsay/cowsay.log"
'';
}
This will move the original binary to something like bin/.cowsay-wrapped, then drop your wrapper script to bin/cosway. The wrapper script is also injected with an environment variable (e.g. $EXE_PATH) that refers to the absolute path of the original binary.
Something like this:
This will move the original binary to something like
bin/.cowsay-wrapped, then drop your wrapper script tobin/cosway. The wrapper script is also injected with an environment variable (e.g.$EXE_PATH) that refers to the absolute path of the original binary.