coq / vscoq

Visual Studio Code extension for Coq
MIT License
336 stars 68 forks source link

Improve flake.nix, add compatibility with pkgs.vscode extensions field #760

Closed redanaheim closed 6 months ago

redanaheim commented 6 months ago

This pull request adds two new outputs, packages.${system}.vscoq-client.[extension, vsix_archive].

The extension derivation builds the out folder in such a way that this derivation can be passed to vscode in Nix to automatically load it as an extension. Specifically, the source (including webpack results in the dist folder) are placed in $out/share/vscode/extensions/maximedenes.vscoq. This is very useful for NixOS users or even people who use a shell.nix to configure their development environment.

The vsix_archive derivation builds the .vsix and places it in $out/share/vscode/extensions.

This PR also adds the lightweight Alejandra formatter output in flake.nix, which is automatically picked up by nix when running the command nix fmt. This is useful for two reasons:

  1. It helps keep the code style consistent in the long flake.nix file.
  2. It lets us use nix fmt in CI, which avoids failing CI when whitespace or other insignificant changes occur in the generated yarn.nix files.
redanaheim commented 6 months ago

Not sure why the one CI check that doesn't even touch Nix failed but I'll look at it

rtetley commented 6 months ago

Thanks for your contribution ! ;-)