I would appreciate any pointers on how to setup Cursor in nix-os on WSL-2
I’ve managed to run the cursor locally.
I installed the cursor as usual on Windows then tried to connect to remote WSL. It asked to install another extension and then attempted to run installation script which is obviously failed.
To fix the installation script, assuming you’re using NixOs-WSL, add this to your configuration:
{ config, ... }: {
wsl = {
wrapBinSh = true;
extraBin = [
{
name = "bash";
src = config.wsl.binShExe;
}
];
};
}
That will provide wrapped bash script that will be used by the installer.
Or, if you want to specify the wrapper explicitly:
{ pkgs, ... }:
let bashWrapper = with pkgs;
runCommand "nixos-wsl-bash-wrapper"
{
nativeBuildInputs = [ makeWrapper ];
} ''
makeWrapper ${bashInteractive}/bin/bash $out/bin/bash \
--prefix PATH ':' ${lib.makeBinPath ([ systemd gnugrep coreutils gnutar gzip getconf gnused procps which gawk wget curl util-linux ])}
'';
in
{
wsl = {
wrapBinSh = true;
extraBin = [
{
name = "bash";
src = "${bashWrapper}/bin/bash";
}
];
};
}
After rebuilding the NixOs restart the cursor and reinstall the server. It should run fine.