- Fix directory creation in
with_nix(), usingrecursive = TRUEindir.create()
rix::rix(): It is not necessary anymore to provide thebranch_namelist element for R packages from GitHub ingit_pkgs.
rix::rix():- error when
ide = "rstudio"and no additional R packages are chosen. In the situation, therStudioWrapperapproach does not work and the resulting Nix expression would not build. The returned error states to either addrstudiotosystem_pkgs, or add R packages inr_pkgsorgit_pkgs.
- error when
- Github Actions: we now use rhub2 for checking the package
rix::rix()docs: explainoptions(rix.sri_hash).- Source code now follows tidyverse style guide thanks to
{styler} - Readme: added section explain comparing {rix} and Nix to other package managers
rix():- Added possibility to install local archives via
local_r_pkgsargument. - Compute hash of git and CRAN archive packages locally if nix is installed.
There also a new
options(rix.sri_hash="API_server"), so that online hashing via http://git2nixsha.dev can be requested even when Nix is installed locally.
- Added possibility to install local archives via
rix():- Now runs
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. - New
message_typeoption to control signalling what is done.
- Now runs
nix_build(),with_nix(): stabilize API; get rid ofexec_modein core functions. In most cases, "non-blocking" system calls are being run for system commands likenix-shellornix-build.rix_init(),nix_build(), andwith_nix(): gain amessage_type = "quiet", which suppresses messages. Further, messaging is standardized via internal helpers called.
- Fine-tune formatting of *.nix files generated
- low-level requests with {curl} -> remove {httr} dependency
- ROpenSci review: complete documentation of internal functions
- remove
nix_fileinterface forwith_nix() - document
- Better messages of comments on top of the generated
default.nixfiles.
- Added the possibility to create "bleeding_edge" and "frozen_edge" environments
- Added the possibility to use radian as the environment's console (courtesy of kupac) and RStudio server
- Added
ga_cachix(), a function to create a GA workflow file that builds and pushes an environment to a Cachix cache
with_nix(): do not use--vanillabecause it does not respect custom code startup via.Rprofilenix_build()andwith_nix(): improvements. Removenix-buildartefact file by usingSys.which()for checking availability.with_nix(): clean all itermediary and output artefacts (files) on exit- Patch
rix()withshell_hook = NULLdefault, Nix-R wrappersnix_build()andwith_nix(); update testfiles with_nix(): trysessionInfo(); fails under R Nixpkgs on darwin- Do not remove
R_LIBS_USERfrom .libPaths() in covr test environment nix_build()&with_nix(): fix segmentation fault with adjustingLD_LIBRARY_PATHtemporarilynix_build(): consistently separate cmd and args fornix-buildsystem commandnix_build(): another guardrail for run-time purity of Nixpkgs R- implement
nix_fileto specify specific.nixfile - Make
nix_shell()andwith_nix()compatible with RStudio on macOS, where the R session is not (yet) started from a shell. Now/nix/var/nix/profiles/default/binis added to thePATHvariable afternix_shell()orwith_nix()are called from an RStudio version of the system (not as Nix package). - Add
rix::init()to initiate and maintain an isolated, project-specific and pure R setup via Nix - update with
glibcLocalespatch -with_nix()needs patch for R <= 4.2.0;glibcLocalesUtf8->gibcLocales - Implement
with_nix()to valuate function in R or shell command vianix-shellenvironment - Added
tar_nix_ga(), a function to run targets pipelines on Github Actions using a Nix expression
-
with_nix(): evaluate and return R functions or shell commands in Nix env:- added
nix_fileargument as alternative toproject_path. Specify*.nixfle defining the Nix software environment in which you want to runexpr. 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/binis added to thePATHvariable whilewith_nix()are called.
- added
-
nix_build()-- invokenix-buildfrom 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/binis added to thePATHvariable whilewith_nix()are called.
-
rix_init()-- create an isolated, project-specific, and runtime-pure R setup via Nix- added
nix_fileargument to specify a specific.nixfile
- added
rix()-- Generate a Nix expressions that build reproducible development environments:shell_hook = NULLbecomes the new default; before it was= "R --vanilla". The new default ensures thatwith_nix()applied on a specificproject_pathdirectory containing a custom.Rprofilefile that was generated withrix_init(), together with adefault.nixexpression file, can read that profile file to effectively enforce run-time pure R libraries (only from Nix store).
-
nix_build()-- invokenix-buildfrom R:- avoided empty file artefact when checking for presence of
nix-buildbinary. The internal helper now usesSys.which("nix-build")for checking availability onPATHin the R session. - added another guardrail for run-time purity of Nixpkgs R by removing the
R_LIBS_USERpath from.libPaths().
- avoided empty file artefact when checking for presence of
-
with_nix()-- evaluate and return R functions or shell commands in Nix env:- Now cleans all itermediary and output artefacts (files) written in Nix
shell (
nix-shell) session environment when exiting. These file artefacts are now written in a subdirectorywith_nixundertempdir()of the current R session and all files are deleted. Now, when anexprerrors in a Nix shell evaluation (i.e. custom R function), but had a previous successful run with a differentexprand/or R global environment state with success and_out.Rdsproduced, the current session fails to bring this output into the current R session. - The code run the Nix-R session defined by
project_path, now attemps to recordsessionInfo()withtry. We found failures of that command under older R versions on Nixpkgs for macOS (i.e., aarch64-darwin). - Fix segmentation faults in tests by temporarily setting
LD_LIBRARY_PATH. - Patched the import of
glibcLocalesUtf8withgibcLocales(imports all locales). This was necessary to support Nixpkgs R versions <= 4.2.0, whereglibcLocalsUtf8derivation was not yet available. We do not sacrifice reproducibility but rather have larger total sizes of derivations involved in the subshell (around 200MB extra).
- Now cleans all itermediary and output artefacts (files) written in Nix
shell (
- added test suite of 17 unit tests using {testthat}
- Add GitHub actions runners on the repository that use system's R or Nix R environments configured with Nix.
nix_build(): consistently separatecmdandargsfornix-buildsystem
- Added
rix::init()to initialize and maintain an isolated, project-specific, and pure R setup via Nix. It accomplishes this by writing a custom.Rprofilethat guarantees R packages can only be attached from Nix paths, preventing unnoticed loading from the system's R user library (R_LIBS_USERand ensuring runtime purity regarding packages and linked libraries). Additionally, it appends/nix/var/nix/profiles/default/binto thePATH. 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. ThePATHwill 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-buildfailed because attributeglibcLocalesUtf8was not found. Fixed by importinggibcLocales. Thanks @motorlearner for reporting.
-
Added
with_nix(), which can evaluate a function in R or shell command vianix-shellenvironment, 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 missingpkgs.mkShellwhenshell_hook = NULL. Bothshell_hook = ""andshell_hook = NULLare 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 viaoptions(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 theglibcLocalesUtf8subset, to not keep the size reasonable.
- fix locale warnings when starting R in linux, which uses glibc (closes
#50). Now, we use
glibcLocalesUtf8from Nix for "x86_64-linux".
- Remove boilerplate code for
rix::rix(tex_pkgs = NULL)
- Added support for installing TeX Live packages via new
rix::rix()argumenttex_pkgs.
- update
inst/extdata/default.nixso that it installs {rix} v0.3.0.
nix_build()now supports--max_jobsflag ofnix-buildviaoptions(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.
- Include
nix_build()in interactive use vignette (#68).
- Fix internal
create_default_nix()so thatproject_pathis directory name. - Updated
inst/extdata/default.nixto latest commit of {rix} prior bumping.
- Patch
rix()to allow emptyr_pkgs(##67). - Patch
rix()to do bug-free calling ofrix_build()within default nix shell.
- New internal helper
create_default_nix()to bootstrap./inst/extdata/default.nix
- Updated Nix historical revision data to include R version 4.3.1.
- Provision a new
shell_hookarg forrix::rix(), which will create ashellHookentry indefault.nix.
inst/extdata/default.nix: useR --vanillain shellHook to not propagate user-specific.Renvironand.Rprofile. Fixes #56
- Patch
inst/exdata/default.nixso thatLOCALE_ARCHIVEshellHook 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 toproject_pathinstead ofnix_file. The patch does not change correct behavior ofnix_build(), hence it is only of cosmetic nature.
nix_build()now correctly checks presence ofnix-build. (4be69b2)
- Added
nix_build()helper that runsnix-buildinteractively from R. (#22) rix()now supports installing packages from GitHub and the CRAN archives.rix()now supports using anixpkgsrevision instead of an R version for reproducibility- Generated
default.nixfiles now also include the call that was made to generate them as top-level comment.
- The
pathargument ofrix()changed toproject_path.
- Basic functionality added.