From cc69aa34f84d35faabf26ba148d4dbf71e1595f3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 11 Jan 2026 19:32:05 +0000 Subject: [PATCH] Add clarifying comments based on code review feedback Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com> --- templates/rde/lib/shell-hook.nix | 1 + templates/rde/overlays/r.nix | 2 ++ templates/rde/scripts/updateDeps.sh | 3 +++ 3 files changed, 6 insertions(+) diff --git a/templates/rde/lib/shell-hook.nix b/templates/rde/lib/shell-hook.nix index 3a4a9d6..56b2159 100644 --- a/templates/rde/lib/shell-hook.nix +++ b/templates/rde/lib/shell-hook.nix @@ -31,6 +31,7 @@ in '' echo "${shellCmds}" echo "==========================================================================" echo "" + # Auto-activate devenv shell if devenv.nix exists (can be disabled in config) ${pkgs.lib.optionalString enabledPackages.devenv "${defaultPackageName}-activateDevenv"} echo "" '' diff --git a/templates/rde/overlays/r.nix b/templates/rde/overlays/r.nix index 4b3136d..b40bee9 100644 --- a/templates/rde/overlays/r.nix +++ b/templates/rde/overlays/r.nix @@ -13,6 +13,8 @@ final: prev: let ++ (with final.extraRPackages; [ httpgd ]) + # Import custom R packages from project root if file exists + # Users can create r-packages.nix in their project to add more packages ++ (prev.lib.optional (builtins.pathExists ./r-packages.nix) (import ./r-packages.nix final.rpkgs)); in { quarto = final.rpkgs.quarto.override {extraRPackages = reqPkgs;}; diff --git a/templates/rde/scripts/updateDeps.sh b/templates/rde/scripts/updateDeps.sh index d0d0c9c..61310a4 100644 --- a/templates/rde/scripts/updateDeps.sh +++ b/templates/rde/scripts/updateDeps.sh @@ -3,8 +3,11 @@ set -euo pipefail echo "🔄 Updating project dependencies..." +# Fetch latest R version from rstats-on-nix +# This command chain: downloads CSV, extracts last line, gets 4th field (date), removes quotes RVER=$( wget -qO- 'https://raw.githubusercontent.com/ropensci/rix/refs/heads/main/inst/extdata/available_df.csv' | tail -n 1 | head -n 1 | cut -d',' -f4 | tr -d '"' ) &&\ +# Update rixpkgs date in flake.nix sed -i "s|rixpkgs.url = \"github:rstats-on-nix/nixpkgs/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}\";|rixpkgs.url = \"github:rstats-on-nix/nixpkgs/$RVER\";|" flake.nix echo "✅ R date is $RVER"