freeman42x / haskell-editor-setup

Easy instructions for setting up Haskell editors / IDEs on any major operating system.
GNU General Public License v3.0
101 stars 15 forks source link

3d - Create a VSCode configuration using Nix and vscode-with-extensions #89

Open puffnfresh opened 4 years ago

puffnfresh commented 4 years ago

nixpkgs has declarative configuration of VSCode with extensions:

https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vscode/with-extensions.nix#L10-L26

It would be great to have an expression for VSCode, preconfigured with HIE and all the other useful extensions.

puffnfresh commented 4 years ago

For when we additionally need configuration:

https://github.com/countoren/VSCodeEnv

freeman42x commented 4 years ago

@puffnfresh It would be great to have an expression for VSCode, preconfigured with HIE and all the other useful extensions.

That means that when a new developer wants to work on the project nix-shell would provide a VSCode with plugins already installed to him?

freeman42x commented 4 years ago

@countoren could you have a chat with @puffnfresh about how this works and related so the solution you provide in your repository? Thank you

countoren commented 4 years ago

sure i would love too, from next week ill have more time. so we look into it.

freeman42x commented 4 years ago

my attempts at getting vscode and hie in nix shell https://github.com/atopuzov/haskellstuff/tree/master/helpers/vscode-hie-ghc865 - @atopuzov

atopuzov commented 4 years ago

I could not get the vscode-with-extensions working as the extensions would not load and there was an error saying read only filesystem so I resorted to using .vscode/extensions.json to suggest the user to install the extensions. ~Seems to be working with cabal projects but crashes if you open a project that uses stack (you can rename the stack.yaml file and then it works)~. Now that there is a stack wrapper stack projects seem happy. Also hit an issue with all-hies and GLIBC (https://github.com/Infinisil/all-hies/issues/32) so I pinned to the same version of nixpkgs all-hies uses for ghc865.

vscode-with-extensions error i get:

[2020-05-25 11:14:25.500] [renderer1] [error] EROFS: read-only file system, open '/nix/store/jaqz1kgvq8ik6hccwavaj7vgsdry59i2-vscode-extensions-1.45.0/share/vscode/extensions/justusadam.language-haskell/package.json': Error: EROFS: read-only file system, open '/nix/store/jaqz1kgvq8ik6hccwavaj7vgsdry59i2-vscode-extensions-1.45.0/share/vscode/extensions/justusadam.language-haskell/package.json'
[2020-05-25 11:14:25.501] [renderer1] [error] EROFS: read-only file system, open '/nix/store/jaqz1kgvq8ik6hccwavaj7vgsdry59i2-vscode-extensions-1.45.0/share/vscode/extensions/alanz.vscode-hie-server/package.json': Error: EROFS: read-only file system, open '/nix/store/jaqz1kgvq8ik6hccwavaj7vgsdry59i2-vscode-extensions-1.45.0/share/vscode/extensions/alanz.vscode-hie-server/package.json'
[2020-05-25 11:14:25.501] [renderer1] [error] EROFS: read-only file system, open '/nix/store/jaqz1kgvq8ik6hccwavaj7vgsdry59i2-vscode-extensions-1.45.0/share/vscode/extensions/bbenoist.Nix/package.json': Error: EROFS: read-only file system, open '/nix/store/jaqz1kgvq8ik6hccwavaj7vgsdry59i2-vscode-extensions-1.45.0/share/vscode/extensions/bbenoist.Nix/package.json'
freeman42x commented 4 years ago

@puffnfresh For consistency with the other tickets, could you put a time estimate in the title of the issue? Thank you

freeman42x commented 4 years ago

I made some changes which provide ghc, etc. inside nix-shell might help: https://github.com/fairy-tale-agi-solutions/haskell-editor-setup/blob/master/shell.nix

freeman42x commented 4 years ago

@puffnfresh Countoren got his vscodeEnv PR merged. Should probably have a look and see how this impacts this ticket:

https://github.com/fairy-tale-agi-solutions/haskell-editor-setup/pull/132