When Nix builds a derivation, its output is saved in the
Nix store located under /nix/store/
. Even though you can import the
derivations into the current R session using rxp_read()
or rxp_load()
,
it can be useful to copy the outputs to the current working directory. This
is especially useful for Quarto documents, where there can be more than one
input, as is the case for html
output.
Arguments
- derivation_name
The name of the derivation to copy. If empty, then all the derivations are copied.
- dir_mode
Character, default "0755". POSIX permission mode to apply to directories under the copied output (including the top-level output directory).
- file_mode
Character, default "0644". POSIX permission mode to apply to files under the copied output.
See also
Other utilities:
print.rxp_derivation()
,
rxp_gc()
,
rxp_init()
,
rxp_inspect()
,
rxp_list_logs()
,
rxp_load()
,
rxp_read()
,
rxp_trace()
Examples
if (FALSE) { # \dontrun{
# Copy all derivations to the current working directory
rxp_copy()
# Copy a specific derivation
rxp_copy("mtcars")
# Copy with custom permissions (e.g., make scripts executable)
rxp_copy("my_deriv", dir_mode = "0755", file_mode = "0644")
# Copy a Quarto document output with multiple files
rxp_copy("my_quarto_doc")
} # }