Skip to content

Making wrapper scripts that do something other than exec? #418

@musjj

Description

@musjj

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions