{ pkgs, lib, ... }: with builtins // lib; { copyFile = { source, directory, executable, target, ... }: '' cp -${if directory then "r" else ""}v "${source}" "${target}" ${optionalString (isBool executable) '' chmod ${if executable then "+" else "-"}x "${target}" ''} ''; }