rix_init()
, rix()
: previous attempt at fixing bug was only partially
correct, it is now fixed. Several more tests were added to avoid this in the
future.rix_init()
, rix()
: fix bug in rix_init()
, that led to empty .Rprofile
files.inst/extdata/default.nix
inst/extdata/default.nix
with this patch release of {rix}NEWS
entries in 0.12.1 released previously, which is the
first CRAN release version.DESCRIPTION
(forgotten in
first CRAN release 0.12.1)rix()
: The is no default argument in project_path
anymore. Before, it
defaulted to the current directory, which violated CRAN policy to have any
default path in writing functions.DESCRIPTION
:
tempdir()
instead of the user
directoryR CMD check
and R CMD build
when running them in a nix-shell --pure
development environment based on the default.nix
of {rix} package root.
Use manually controlled Nix expression from r_ver = "latest"
pinned source.rix::rix()
: Clean detrius files/folders in temporary folders that are not
needed. Also fixes failing vignette builds in R CMD build
(including helpers
rix::rix_init()
, rix:::hash_url()
) by properly handling file connections,
closing them on exit, and unlink temporary file folders. (#308)nix_build()
: Fix SIGINT termination (ctrl+c) for linux, so that all the
nix-build
background processes are properly stopped when the user interupts
the build process.rix::rix()
: when hashing Git provider packages (e.g., GitHub) remotely via
the https://git2nixsha.dev API, https protocol is now used (previously http).
Hashing via this service is done when Nix is not installed or when requested
via option.default.nix
for {rix} development environment.pre-commit
config because it does not play well with Nix
(R-tooling/package inst based on {renv})R CMD check
pass without NOTE
because of file artefacts when running
vignettes and doing tests (tests/testthat/test-rix.R
){rix}
is now an rOpenSci package!
with_nix()
, using recursive = TRUE
in
dir.create()
rix::rix()
: It is not necessary anymore to provide the branch_name
list
element for R packages from GitHub in git_pkgs
.rix::rix()
:
ide = "rstudio"
and no additional R packages are
chosen. In the situation, the rStudioWrapper
approach does not work and the
resulting Nix expression would not build. The returned error states to either
add rstudio
to system_pkgs
, or add R packages in r_pkgs
or git_pkgs
.rix::rix()
docs: explain options(rix.sri_hash)
.{styler}
rix()
:
local_r_pkgs
argument.options(rix.sri_hash="API_server")
, so that online
hashing via http://git2nixsha.dev can be requested even when Nix is
installed locally.rix()
:
rix_init()
to ensure runtime purity via .Rprofile
.
This will exclude the system's user library from .libPaths()
, so that the
search path will only contain a path each per package in the Nix store.message_type
option to control signalling what is done.nix_build()
, with_nix()
: stabilize API; get rid of exec_mode
in core functions. In most cases, "non-blocking" system calls are being run for system commands like nix-shell
or nix-build
.rix_init()
, nix_build()
, and with_nix()
: gain a
message_type = "quiet"
, which suppresses messages. Further, messaging is
standardized via internal helpers called.nix_file
interface for with_nix()
default.nix
files.ga_cachix()
, a function to create a GA workflow file that builds and pushes an environment to a Cachix cachewith_nix()
: do not use --vanilla
because it does not respect custom code startup via .Rprofile
nix_build()
and with_nix()
: improvements. Remove nix-build
artefact file by using Sys.which()
for checking availability. with_nix()
: clean all itermediary and output artefacts (files) on exitrix()
with shell_hook = NULL
default, Nix-R wrappers nix_build()
and with_nix()
; update testfileswith_nix()
: try sessionInfo()
; fails under R Nixpkgs on darwinR_LIBS_USER
from .libPaths() in covr test environmentnix_build()
& with_nix()
: fix segmentation fault with adjusting LD_LIBRARY_PATH
temporarilynix_build()
: consistently separate cmd and args for nix-build
system commandnix_build()
: another guardrail for run-time purity of Nixpkgs Rnix_file
to specify specific .nix
filenix_shell()
and with_nix()
compatible with RStudio on macOS, where the R session is not (yet) started from a shell. Now /nix/var/nix/profiles/default/bin
is added to the PATH
variable after nix_shell()
or with_nix()
are called from an RStudio version of the system (not as Nix package).rix::init()
to initiate and maintain an isolated, project-specific and pure R setup via NixglibcLocales
patch
-with_nix()
needs patch for R <= 4.2.0; glibcLocalesUtf8
-> gibcLocales
with_nix()
to valuate function in R or shell command via nix-shell
environmenttar_nix_ga()
, a function to run targets pipelines on Github Actions using a Nix expressionwith_nix()
: evaluate and return R functions or shell commands in Nix env:
nix_file
argument as alternative to project_path
. Specify *.nix
fle defining the Nix software environment in which you want to run expr
.macOS
: made it compatible with system's RStudio version on macOS, where
the R session can not (yet) be started from a shell when launched from Dock.
Now /nix/var/nix/profiles/default/bin
is added to the PATH
variable
while with_nix()
are called.nix_build()
-- invoke nix-build
from R:
macOS
: made it compatible with system's RStudio version on macOS, where
the R session can not (yet) be started from a shell when launched from Dock.
Now /nix/var/nix/profiles/default/bin
is added to the PATH
variable
while with_nix()
are called.rix_init()
-- create an isolated, project-specific, and runtime-pure R setup via Nix
nix_file
argument to specify a specific .nix
filerix()
-- Generate a Nix expressions that build reproducible development
environments:
shell_hook = NULL
becomes the new default; before it was
= "R --vanilla"
. The new default ensures that with_nix()
applied on
a specific project_path
directory containing a custom .Rprofile
file
that was generated with rix_init()
, together with a default.nix
expression file, can read that profile file to effectively enforce run-time
pure R libraries (only from Nix store).nix_build()
-- invoke nix-build
from R:
nix-build
binary.
The internal helper now uses Sys.which("nix-build")
for checking
availability on PATH
in the R session.R_LIBS_USER
path from .libPaths()
.with_nix()
-- evaluate and return R functions or shell commands in Nix env:
nix-shell
) session environment when exiting. These file artefacts
are now written in a subdirectory with_nix
under tempdir()
of the
current R session and all files are deleted. Now, when an expr
errors
in a Nix shell evaluation (i.e. custom R function), but had a previous
successful run with a different expr
and/or R global environment state
with success and _out.Rds
produced, the current session fails to bring
this output into the current R session.project_path
, now attemps to
record sessionInfo()
with try
. We found failures of that command under
older R versions on Nixpkgs for macOS (i.e., aarch64-darwin).LD_LIBRARY_PATH
.glibcLocalesUtf8
with gibcLocales
(imports all
locales). This was necessary to support Nixpkgs R versions <= 4.2.0, where
glibcLocalsUtf8
derivation was not yet available. We do not sacrifice
reproducibility but rather have larger total sizes of derivations involved
in the subshell (around 200MB extra).nix_build()
: consistently separate cmd
and args
for nix-build
systemrix::init()
to initialize and maintain an isolated, project-specific,
and pure R setup via Nix. It accomplishes this by writing a custom .Rprofile
that guarantees R packages can only be attached from Nix paths, preventing
unnoticed loading from the system's R user library (R_LIBS_USER
and ensuring
runtime purity regarding packages and linked libraries). Additionally, it
appends /nix/var/nix/profiles/default/bin
to the PATH
. Currently, this
modification only takes effect in the current R session and not in new R
sessions for RStudio on MacOS. This is because the default R session is not
started from a shell. The PATH
will be modified by RStudio when starting the
R session, effectively after loading the local .Rprofile
. Future versions
of RStudio will hopefully respect all environmental variables from a shell
environment.rix::rix()
: patch for nixpkgs revisions corresponding to R (r_ver
)
<= 4.2.0; nix-build
failed because attribute glibcLocalesUtf8
was
not found. Fixed by importing gibcLocales
. Thanks @motorlearner for
reporting.Added with_nix()
, which can evaluate a function in R or shell command via
nix-shell
environment, and return the output into the current R session.
This works for both evaluating R code from a nix-R session within an other
nix-R session, or also from a host R session (i.e., on macOS or linux) within
a specific nix-R session. This feature is useful to test dependencies and
specific setups of software in controlled environments.
Added tar_nix_ga()
, a function to run targets pipelines on Github Actions
using a Nix expression.
rix::rix()
: fix missing pkgs.mkShell
when shell_hook = NULL
.
Both shell_hook = ""
and shell_hook = NULL
are now producing valid nix
expressions.rix::rix()
now defaults to "en_US.UTF-8"
for the relevant locale
variables (LANG
, LC_ALL
, LC_TIME
, LC_MONETARY
, LC_PAPER
,
LC_MEASUREMENT
) and sets these environment variables in
the Nix shell. These will be correctly propagated into the Nix R session.
Users can modify the locale setting via
options(rix.nix_locale_variables = list(LANG = "de_CH.UTF-8", <...>)
, e.g.,
but it needs to be an UTF-8 locale. This is because we only import the
glibcLocalesUtf8
subset, to not keep the size reasonable.glibcLocalesUtf8
from Nix for "x86_64-linux".rix::rix(tex_pkgs = NULL)
rix::rix()
argument tex_pkgs
.inst/extdata/default.nix
so that it installs {rix} v0.3.0.nix_build()
now supports --max_jobs
flag of nix-build
via options(rix.nix_build_max_jobs = <integer>)
. Custom settings of this option can be useful for leveraging full I/O latency or efficient builds on shared memory multiprocessing systems.nix_build()
in interactive use vignette (#68).create_default_nix()
so that project_path
is directory name.inst/extdata/default.nix
to latest commit of {rix} prior bumping.rix()
to allow empty r_pkgs
(##67).rix()
to do bug-free calling of rix_build()
within default nix
shell.create_default_nix()
to bootstrap
./inst/extdata/default.nix
shell_hook
arg for rix::rix()
, which will create a shellHook
entry in default.nix
.inst/extdata/default.nix
: use R --vanilla
in shellHook to not propagate user-specific .Renviron
and .Rprofile
. Fixes #56inst/exdata/default.nix
so that LOCALE_ARCHIVE
shellHook that was set to
glibc locale does not fail on MacOS anymore
(#40; fixed with 37f7ab8).nix_build()
: fix defensive check so the error message is referring to project_path
instead of nix_file
. The patch does not change correct behavior of nix_build()
,
hence it is only of cosmetic nature.nix_build()
now correctly checks presence of nix-build
. (4be69b2)nix_build()
helper that runs nix-build
interactively from R.
(#22)rix()
now supports installing packages from GitHub and the CRAN archives.rix()
now supports using a nixpkgs
revision instead of an R version
for reproducibilitydefault.nix
files now also include the call that was made to
generate them as top-level comment.path
argument of rix()
changed to project_path
.