rix  by ropensci

Reproducible R, Python, and Julia environments with Nix

Created 2 years ago
346 stars

Top 80.4% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

Reproducible Data Science environments for R with Nix

rix provides reproducible R data science environments using Nix, a package manager for reproducible builds. It targets researchers and developers needing consistent project setups across platforms and time. By managing R versions, R packages, and system dependencies holistically, rix ensures full reproducibility, simplifying collaboration and deployment.

How It Works

This R package simplifies Nix environment creation by generating Nix expressions (default.nix) for isolated R setups. It allows specifying R versions, R packages, system libraries (e.g., GDAL), and even Python/Julia environments. Nix builds immutable, reproducible environments, offering superior reproducibility over tools like renv by capturing system dependencies and providing a declarative alternative to Docker. A fork of Nixpkgs enhances compatibility, especially for Apple Silicon.

Quick Start & Requirements

  • Prerequisites: Nix package manager.
  • Installation: install.packages("rix") (CRAN) or install.packages("rix", repos = c("https://ropensci.r-universe.dev")) (R-universe).
  • Setup: Run rix() in R to generate default.nix and .Rprofile. For Nix users: install Nix, configure Cachix (rix::setup_cachix()), and trust the Nix daemon.
  • Running: Enter Nix shell with nix-shell -p R rPackages.rix or build with nix_build().
  • Docs: Vignettes available for getting started, Nix inside Docker, and platform setup.

Highlighted Details

  • Supports R, CRAN, Bioconductor, Python, and Julia packages.
  • Generates Nix environments from renv.lock files.
  • Integrates with IDEs (VS Code) and CI/CD.
  • Enables Docker image creation with defined R environments.
  • Offers granular control over R versions (development, historical, dated).
  • Includes an LLM context file (rix.pkgctx.yaml) for code generation.

Maintenance & Community

Part of the rOpenSci ecosystem. Acknowledges Nix community contributions and the Nixpkgs R channel (#r:nixos.org on Matrix). Adheres to a Contributor Code of Conduct. Related package rixpress for polyglot pipelines.

Licensing & Compatibility

The license type is not explicitly stated in the provided README content. Commercial use compatibility is not detailed.

Limitations & Caveats

Nix has a steep learning curve. A small percentage (<5%) of CRAN/Bioconductor packages may not be supported. Python/Julia environment builds may occasionally fail, requiring user issue reporting.

Health Check
Last Commit

2 days ago

Responsiveness

Inactive

Pull Requests (30d)
12
Issues (30d)
0
Star History
8 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.