nix-community / nix-vscode-extensions

Nix expressions for VSCode and OpenVSX extensions [maintainers: @deemp, @AmeerTaweel]
MIT License
169 stars 9 forks source link

How to create custom extension from .vsix url? #42

Closed ranuwp closed 11 months ago

ranuwp commented 11 months ago

I have issue to install Cucumber Extension in latest VScode version. There is a fork to fix the issue from other developer and they provide .vsix to solve the extension compatibility.

Here is .vsix that solve the issues: https://github.com/xeger/cucumber-vscode/releases/tag/v1.7.1

How to add it in nix-vscode-extensions so that it can be used in nix VSCode?

I use flake.nix to run the nix

ranuwp commented 11 months ago

I've found it by creating extension variable in flake.nix.

cucumber-extension = packages.vscode-utils.buildVscodeMarketplaceExtension rec {
  mktplcRef = {
    name = "xeger";
    version = "1.7.1";
    publisher = "no-publisher";
  };
  vsix = builtins.fetchurl {
    name = "${mktplcRef.publisher}-${mktplcRef.name}.zip";
    url = "https://github.com/xeger/cucumber-vscode/releases/download/v1.7.1/cucumber-official-1.7.1.vsix"; # Replace with your source URL
    sha256 = "1h1gskszhw1mk9kmj0qbd8g344bvhj6bn4shil0vcayb37fbjdcd";
  };
};