# run stow to populate the target directory with the given stow package, read from stowDir.
# Bear in mind that `stowDirOriginPath` should always be semantically bound to the given `stowDir`, otherwise stow might become rather confused.
runStow={
# “stow package” to stow (see manpage)
stowPackage,
# “target directory” to stow in (see manpage)
targetDir,
# The “stow directory” (see manpage), containing “stow packages” (see manpage)
stowDir,
# representative directory for the stowDir in the file system, against which stow will create relative links.
# ATTN: this is always overwritten with the contents of `stowDir`! You shouldn’t re-use the same `stowDirOriginPath` for different `stowDir`s, otherwise there might be surprises.
stowDirOriginPath,
}:depot.nix.writeExecline"stow-${stowPackage}"{}[
# first, create a temporary stow directory to use as source
# (stow will use it to determine the origin of files)