about summary refs log tree commit diff
path: root/pkgs/applications/editors/vscode/extensions/mktplcExtRefToFetchArgs.nix
blob: 4f947a493542f74dd97823019cc96d4e2b4a9f16 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
  publisher,
  name,
  version,
  arch ? "",
  sha256 ? "",
  hash ? "",
}:
let
  archurl = (if arch == "" then "" else "?targetPlatform=${arch}");
in
{
  url = "https://${publisher}.gallery.vsassets.io/_apis/public/gallery/publisher/${publisher}/extension/${name}/${version}/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage${archurl}";
  inherit sha256 hash;
  # The `*.vsix` file is in the end a simple zip file. Change the extension
  # so that existing `unzip` hooks takes care of the unpacking.
  name = "${publisher}-${name}.zip";
}