diff --git a/pkgs/development/r-modules/default.nix b/pkgs/development/r-modules/default.nix index 7cfb8e54f275..82cc0955a4fb 100644 --- a/pkgs/development/r-modules/default.nix +++ b/pkgs/development/r-modules/default.nix @@ -1275,6 +1275,17 @@ let ''; }); + sparklyr = old.sparklyr.overrideAttrs (attrs: { + # Pyspark's spark is full featured and better maintained than pkgs.spark + preConfigure = '' + substituteInPlace R/zzz.R \ + --replace ".onLoad <- function(...) {" \ + ".onLoad <- function(...) { + Sys.setenv(\"SPARK_HOME\" = Sys.getenv(\"SPARK_HOME\", unset = \"${pkgs.python3Packages.pyspark}/lib/${pkgs.python3Packages.python.libPrefix}/site-packages/pyspark\")) + Sys.setenv(\"JAVA_HOME\" = Sys.getenv(\"JAVA_HOME\", unset = \"${pkgs.openjdk}\"))" + ''; + }); + proj4 = old.proj4.overrideAttrs (attrs: { preConfigure = '' substituteInPlace configure \