Replies: 4 comments 4 replies
-
It looks like Nix's methods for launching R with its intended modifications to As a hack or experiment, you could tell Positron about the actual "binary", which seems to be at https://positron.posit.co/r-installations.html#customizing-r-discovery That will bypass the efforts to configure |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
It occurs as Positron Checks for the String "Shell wrapper for R executable" and "R_HOME_DIR" in the Shell Script, which NixOS' rWrapper does not contain. r-set = (rWrapper.override { packages = rpkgs; }).overrideAttrs (
finalAttrs: previousAttrs: {
buildCommand =
previousAttrs.buildCommand
+ ''
# Modify the R script to add the desired comment
sed -i '2i# Shell wrapper for R executable' $out/bin/R
sed -i '3iR_HOME_DIR=${pkgs.R}/lib/R' $out/bin/R
'';
}
); Fixed it for me. |
Beta Was this translation helpful? Give feedback.
-
Currently, the easiest way to use positron with nix is with something like the following: let
pkgs = import <nixpkgs> { };
in
pkgs.mkShell {
packages = [
# Positron
pkgs.positron-bin
# R & packages.
pkgs.R
pkgs.rPackages.httr
pkgs.rPackages.ggplot2
# Python, ipykernel & packages.
# pkgs.python313
# pkgs.python313Packages.ipykernel # NOTE: Required for python.
# pkgs.python313Packages.pandas
# pkgs.python313Packages.requests
];
} You can drop this snippet into a "default.nix" file, adjust to your needs, and use The If you have other questions or issues, feel free to open an issue in nixos/nixpkgs and/or ping me. I co-maintain the nixpkgs version of positron (not officially supported by Posit) along with @b-rodrigues and either of us are happy to help with these kinds of questions! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm having trouble setting up R for Positron on NixOS. My R version is 4.4.2, and I can access it with the
R
command from my CLI without issues. However, Positron is unable to recognize it, giving the following error in the Positron R Extension output:It seems Positron is finding the R binary, but it's not recognizing it as a valid R installation because it's not a shell script wrapper as Positron expects. Below is the last few lines of the
/nix/store/pn5156f5qm6vrm23df6r1vz2hfqdbcji-R-4.4.2-wrapper/bin/R
And here is the content of
/nix/store/yhbsa7kjw2zdj30x4gpfzammglggbj9h-R-4.4.2/bin/R
Beta Was this translation helpful? Give feedback.
All reactions