np/templates/rde/hosts/r.nix
copilot-swe-agent[bot] 40095ac868 Add comprehensive inline documentation to all modules and enhance README
Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com>
2026-01-11 19:40:13 +00:00

31 lines
1.1 KiB
Nix

# R-related host configurations
#
# This module defines R-related commands available in the dev shell.
# R is configured with project-local package library and Quarto support.
#
# Available commands (when R is enabled):
# - <name>-r: Launch R console with packages
#
# How it works:
# - Uses rWrapper which includes all packages from overlays/r.nix
# - R_LIBS_USER=./.Rlibs enables project-local package installation
# - --no-save --no-restore ensures clean session startup
#
# Package management:
# - System packages: Edit overlays/r.nix
# - Project packages: Install with install.packages() in R
# - Custom packages: Create r-packages.nix in project root
#
# Dependencies: rWrapper, quarto, air-formatter (configured in flake.nix)
config: pkgs: {
# r: R console with pre-configured packages
# Includes tidyverse, data.table, and other common packages
# Session starts without saving/restoring workspace
r = {
enable = config.enabledLanguages.r;
path = {
value = "${pkgs.rWrapper}/bin/R";
args = ["--add-flags" "--no-save --no-restore"];
};
};
}