Does anyone have a configuration for using VSCode's remote ssh connection to use h-ide where the connection needs to first enter a nix-shell? I've tried using direnv but I can't seem to make the .envrc load the nix shell before h-ide gives up on finding cabal (and any other dependency needed from the nix-shell in question.
It should "just work" (I use remote ssh all the time), due to arrterian.nix-env-selector.
For some projects, I use direnv, and you just need use flake in ./.envrc, followed by direnv allow. Then, when you open the workspace remotely, keep all tabs closed. Open flake.nix first, wait a second or two, then open a .hs file.
It should "just work" (I use remote ssh all the time), due to arrterian.nix-env-selector.
For some projects, I use direnv, and you just need use flake in ./.envrc, followed by direnv allow. Then, when you open the workspace remotely, keep all tabs closed. Open flake.nix first, wait a second or two, then open a .hs file.
Huh, I've tried the latter with obelisk's ob shell in direnv and no matter how long i give it before opening tabs, it always breaks. Have you been able to do it with obelisk?
To be clear, I can allow the direnv and I can see the VM's cpu resources spike as things load, so I know it's working. I just can't seem to make h-ide load at the right time.
I've been using HLS with obelisk for a couple years now without a problem. To do it locally, I simply need to launch code from ob shell (Can also do nix-shell -A shells.ghc but this doesn't load cabal tests.). AFAICT, ob shell just manually builds up a custom nix-shell so it shouldn't be that different.
There are some issues still with getting the shell loaded prior to VSCode initializing plugins, so I have a hack that just creates an .envrc with the PATH set by ob shell; this appears to load everything correctly.
Though I'm still working on getting upstream deps in the right place to build HLS with the same GHC used in the project. For some reason, the HLS-VSCode managed HIDE binaries work without a problem on darwin but they break on template haskell splices on linux. The latter breakage causes many of the useful plugins (code lenses, go to, etc) to break.
Does anyone have a configuration for using VSCode's remote ssh connection to use h-ide where the connection needs to first enter a nix-shell? I've tried using
direnv
but I can't seem to make the .envrc load the nix shell before h-ide gives up on finding cabal (and any other dependency needed from thenix-shell
in question.My template doesn't require direnv: https://github.com/srid/haskell-template
It should "just work" (I use remote ssh all the time), due to
arrterian.nix-env-selector
.For some projects, I use direnv, and you just need
use flake
in./.envrc
, followed bydirenv allow
. Then, when you open the workspace remotely, keep all tabs closed. Open flake.nix first, wait a second or two, then open a .hs file.For some reason HLS breaks when a workspace is opened with pre-opened .hs tabs. Also keep your terminal turned off at window open time.
Sridhar Ratnakumar said:
Huh, I've tried the latter with obelisk's
ob shell
in direnv and no matter how long i give it before opening tabs, it always breaks. Have you been able to do it with obelisk?To be clear, I can allow the direnv and I can see the VM's cpu resources spike as things load, so I know it's working. I just can't seem to make h-ide load at the right time.
Oh, obelisk is a different beast. They don't even support HLS afaict. I don't use ghcjs anymore, but I think you want https://github.com/obsidiansystems/obelisk/issues/762
Sridhar Ratnakumar said:
I've been using HLS with obelisk for a couple years now without a problem. To do it locally, I simply need to launch code from
ob shell
(Can also donix-shell -A shells.ghc
but this doesn't load cabal tests.). AFAICT,ob shell
just manually builds up a customnix-shell
so it shouldn't be that different.@o1lo01ol1o https://github.com/obsidiansystems/obelisk/issues/184#issuecomment-869083916
looks like
use nix -A shells.ghc
should work(but you still need HLS in nix shell I think)
Sridhar Ratnakumar said:
Yes, that's provided by the
shellTools
attribute in the nix derivation. can Iuse ob shell
?Ah, I see, I missed that issue. Will investigate, thanks!
There are some issues still with getting the shell loaded prior to VSCode initializing plugins, so I have a hack that just creates an
.envrc
with the PATH set byob shell
; this appears to load everything correctly.Though I'm still working on getting upstream deps in the right place to build HLS with the same GHC used in the project. For some reason, the HLS-VSCode managed HIDE binaries work without a problem on
darwin
but they break on template haskell splices onlinux
. The latter breakage causes many of the useful plugins (code lenses, go to, etc) to break.