Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

redanaheim
Copy link
Contributor

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.

- Add new packages.${system}.vscoq-client.[extension, vsix_archive] derivations

     - `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
    - `vsix_archive` derivation builds the vsix and places it in $out/share/vscode/extensions

- Add formatter
    - Add `nix fmt` in CI before yarn.nix check

- Use attribute sets instead of property accesses for less boilerplate
@redanaheim
Copy link
Contributor Author

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

@rtetley rtetley merged commit 8a30a03 into coq:main Apr 2, 2024
16 checks passed
@rtetley
Copy link
Collaborator

rtetley commented Apr 2, 2024

Thanks for your contribution ! ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants