Configuring Positron and nix on Windows WSL #387
Replies: 1 comment 2 replies
-
Hi Anatolii I don’t use Positron nor Windows, so I don’t know if I’ll be able to help. However, I do have a few thoughts:
my guess is that you could then "ssh into" a running container from this image with the right dependencies. |
Beta Was this translation helpful? Give feedback.
-
Hey guys, looking for some help and advice. I cannot connect to a custom R installation on Positron v
2025.01.0-39
when connecting to a remote machine via SSH (Ubuntu 24 on WSL2).I am trying to configure the Nix environment with the help of the
rix
package. The problem arises when Positron cannot find the R executable, which is stored in a non-standard location. Settingpositron.r.customBinaries
doesn't seem to help.I am running a fresh install of
Ubuntu 24.04.1 LTS
on WSL2, and Positron connects via SSH, configured on WSL withopenssh-server
. Apart from system dependencies likelibcurl4-openssl-dev
andcurl
, everything was configured with Nix. Below is the content of thedefault.nix
file.After running
nix-build
andnix-shell
, I am able to run R in nix-shell in my terminal, but not in the Positron Console, which is expected, as R was installed into/nix/store/lw2scvxw0vfgzva4qmglh03vk27yxaqg-R-4.4.2/bin/R
, which is not the default location. While, I can configurepositron.r.customBinaries
in the remote machine's Positron settings to look at and run R from the Nix store. But how can I run R in the Positron console fromnix-shell
?In other words, these settings work, and I can run at least some R:
However, I want to run R from
nix-shell
; therefore, I tried to configure a shell script, which can then be passed to thepositron.r.customBinaries
:and don't forget to make it executable with
chmod +x nixr.sh
. So now my Positron settings look like:The output console shows me, that it ignores my shell script, and just using the
nix/store
version:So the question is, how can I make Positron work within the Nix environment on remote machines? Is it even possible?
To repdroduce the issue from scratch
Setup username and password
Configure Positron ssh connection
Then, add to the end of the file the following lines:
Start and enable openssh server
Edit on Windows your WSL config located at
%USERPROFILE%\.ssh\config
by adding:Connect in Positron via
remote-ssh
extension and wait while positron insalls its server. So, since there is no R installed on the WSL, Positron will not run any interpreters. I was installing R usingnix
following thisThen, create a
nixr.sh
script in home location (~/
) and make it executable.Beta Was this translation helpful? Give feedback.
All reactions