haskell-editor-setup icon indicating copy to clipboard operation
haskell-editor-setup copied to clipboard

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

Open puffnfresh opened this issue 5 years ago • 9 comments

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 avatar May 23 '20 09:05 puffnfresh

For when we additionally need configuration:

https://github.com/countoren/VSCodeEnv

puffnfresh avatar May 23 '20 10:05 puffnfresh

@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 avatar May 24 '20 07:05 freeman42x

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

freeman42x avatar May 24 '20 07:05 freeman42x

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

countoren avatar May 24 '20 13:05 countoren

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

freeman42x avatar May 24 '20 21:05 freeman42x

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'

atopuzov avatar May 24 '20 21:05 atopuzov

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

freeman42x avatar May 25 '20 10:05 freeman42x

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 avatar May 26 '20 12:05 freeman42x

@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

freeman42x avatar Jun 09 '20 19:06 freeman42x