about summary refs log tree commit diff
path: root/pkgs/applications/editors
diff options
context:
space:
mode:
authorV <v@anomalous.eu>2024-04-05 21:27:23 +0200
committerV <v@anomalous.eu>2024-04-05 23:23:44 +0200
commitd9d0e40aeb44274d9a6faa44d5aceb49a31ad9bc (patch)
treed7aabf46fedb3c113301a65691b6c2f1d1ff4338 /pkgs/applications/editors
parentd20ddd76a41e7cfc4f70f99b1ac23ba0a7359175 (diff)
vscode-utils: allow `hash` to be used in mktplcRef
SRI hashes are the new standard throughout Nixpkgs. Although `sha256`
can be set to an SRI hash, it would be better to start using the generic
attribute everywhere instead.

Change-Id: Ie4fdd1e8bf7082d2d73802253c9aec45f99b1b96
Diffstat (limited to 'pkgs/applications/editors')
-rw-r--r--pkgs/applications/editors/vscode/extensions/mktplcExtRefToFetchArgs.nix4
-rw-r--r--pkgs/applications/editors/vscode/extensions/vscode-utils.nix1
2 files changed, 3 insertions, 2 deletions
diff --git a/pkgs/applications/editors/vscode/extensions/mktplcExtRefToFetchArgs.nix b/pkgs/applications/editors/vscode/extensions/mktplcExtRefToFetchArgs.nix
index e871baa608efa..6c7ba096f6c58 100644
--- a/pkgs/applications/editors/vscode/extensions/mktplcExtRefToFetchArgs.nix
+++ b/pkgs/applications/editors/vscode/extensions/mktplcExtRefToFetchArgs.nix
@@ -1,10 +1,10 @@
-{ publisher, name, version, arch ? "", sha256 ? "" }:
+{ 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}";
-  sha256 = sha256;
+  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";
diff --git a/pkgs/applications/editors/vscode/extensions/vscode-utils.nix b/pkgs/applications/editors/vscode/extensions/vscode-utils.nix
index 0eba230ad8e03..5712fe6714238 100644
--- a/pkgs/applications/editors/vscode/extensions/vscode-utils.nix
+++ b/pkgs/applications/editors/vscode/extensions/vscode-utils.nix
@@ -74,6 +74,7 @@ let
     "publisher"
     "version"
     "sha256"
+    "hash"
     "arch"
   ];