NixOS, VS Code and Haskell-related extensions for VS Code

I am a Windows/Windows Terminal/VS Code user, experimenting with NixOS/Plasma as a dual boot (principally with the long term aim to support better users of Stack on NixOS).

I’ve configured NixOS to have Stack (the stack package) and VS Code (the vscode package) but I’m not sure how to configure things so that VS Code can make use of the popular Haskell-related VS Code extensions.

I am particularly interested in syntax highlighting. I see that there have been some developments in that regard:

I’m also interested in the ‘Haskell’ VS Code extension, if it can work on NixOS.

On Windows, I use Stack to manage GHC versions and Stack versions; and the Haskell extension for VS Code uses GHCup to manage HLS versions.

On NixOS, Stack uses Nix to manage GHC versions.

Any advice on configuration would be greatly appreciated.

I think I just installed the Haskell extension from the vscode marketplace like normal. I don’t use home-manager though and maybe there is also a nix derivation for it, but I didn’t bother with that.

If you want HLS then you should know that ghcup doesn’t work on nixos, but you can easily install HLS with nix and then configure the Haskell vscode extension to use that manually installed version. I think the option is called “language server executable path” or something similar.